diff --git a/examples/chip-tool-darwin/templates/README.zapt b/examples/chip-tool-darwin/templates/README.zapt index 01ed38559b29e5..00f85baa6ce77b 100644 --- a/examples/chip-tool-darwin/templates/README.zapt +++ b/examples/chip-tool-darwin/templates/README.zapt @@ -1,6 +1,6 @@ # Command Details -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{#chip_cluster_commands}} {{#first}}
{{parent.name}}

diff --git a/examples/chip-tool-darwin/templates/commands.zapt b/examples/chip-tool-darwin/templates/commands.zapt index b1f8d013d227b5..27aced738ad627 100644 --- a/examples/chip-tool-darwin/templates/commands.zapt +++ b/examples/chip-tool-darwin/templates/commands.zapt @@ -18,7 +18,7 @@ {{> clusters_header}} -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{> cluster_header}} {{#chip_cluster_commands}} @@ -30,6 +30,7 @@ class {{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}: public ClusterC public: {{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}(): ClusterCommand("{{asDelimitedCommand name}}"){{#zcl_command_arguments}}{{#if_chip_complex}}, mComplex_{{asUpperCamelCase label}}(&mRequest.{{asLowerCamelCase label}}){{/if_chip_complex}}{{/zcl_command_arguments}} { + (void)mRequest; // Might not be used if we have no complex args {{#chip_cluster_command_arguments}} {{#if_chip_complex}} AddArgument("{{asUpperCamelCase label}}", &mComplex_{{asUpperCamelCase label}}); @@ -106,9 +107,9 @@ public: } private: + chip::app::Clusters::{{asUpperCamelCase clusterName}}::Commands::{{asUpperCamelCase name}}::Type mRequest; {{#chip_cluster_command_arguments}} {{#if_chip_complex}} - chip::app::Clusters::{{asUpperCamelCase parent.clusterName}}::Commands::{{asUpperCamelCase parent.name}}::Type mRequest; TypedComplexArgument<{{zapTypeToEncodableClusterObjectType type ns=parent.parent.name}}> mComplex_{{asUpperCamelCase label}}; {{else if (isString type)}} {{#if isOptional}}chip::Optional{{else}}chip::ByteSpan{{/if}} m{{asUpperCamelCase label}}; @@ -281,7 +282,7 @@ public: /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} void registerCluster{{asUpperCamelCase name}}(Commands & commands) { using namespace chip::app::Clusters::{{asUpperCamelCase name}}; @@ -335,7 +336,7 @@ void registerClusterAny(Commands & commands) void registerClusters(Commands & commands) { registerClusterAny(commands); -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} registerCluster{{asUpperCamelCase name}}(commands); {{/chip_client_clusters}} } diff --git a/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt b/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt index 6ea0650e10aba2..773626497c4504 100644 --- a/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt +++ b/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc-src.zapt @@ -1,4 +1,3 @@ -{{#if (chip_has_client_clusters)}} {{> header}} #import #import @@ -18,7 +17,7 @@ using chip::Callback::Callback; using chip::Callback::Cancelable; using namespace chip::app::Clusters; -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} @interface CHIPTest{{asUpperCamelCase name}} () @property (readonly) chip::Controller::{{asUpperCamelCase name}}ClusterTest cppCluster; @@ -61,4 +60,3 @@ using namespace chip::app::Clusters; @end {{/chip_client_clusters}} -{{/if}} diff --git a/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc.zapt b/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc.zapt index 3758a79357d26c..a0c3b5a7c58168 100644 --- a/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc.zapt +++ b/examples/chip-tool-darwin/templates/tests/CHIPTestClustersObjc.zapt @@ -1,4 +1,3 @@ -{{#if (chip_has_client_clusters)}} {{> header}} #import @@ -7,7 +6,7 @@ NS_ASSUME_NONNULL_BEGIN -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} /** * Cluster {{name}} @@ -26,4 +25,3 @@ NS_ASSUME_NONNULL_BEGIN {{/chip_client_clusters}} NS_ASSUME_NONNULL_END -{{/if}} diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 5dd54fce3a3a78..e2777b24ec3c80 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -46,7 +46,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const {{ {{/zcl_events}} {{/zcl_clusters}} -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{#zcl_commands_source_server}} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const {{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & value) { @@ -67,7 +67,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP switch (path.mClusterId) { -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{#zcl_attributes_server}} {{#first}} case {{asUpperCamelCase parent.name}}::Id: @@ -102,7 +102,7 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa switch (path.mClusterId) { -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{#zcl_commands_source_server}} {{#first}} case {{asUpperCamelCase parent.name}}::Id: @@ -158,7 +158,7 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip switch (header.mPath.mClusterId) { -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{#chip_server_cluster_events}} {{#first}} case {{asUpperCamelCase parent.name}}::Id: diff --git a/examples/chip-tool/templates/logging/DataModelLogger.zapt b/examples/chip-tool/templates/logging/DataModelLogger.zapt index 6b508bfeda7230..69550b9bdf12b1 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger.zapt @@ -10,7 +10,7 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::C {{/zcl_events}} {{/zcl_clusters}} -{{#chip_client_clusters}} +{{#chip_client_clusters includeAll=true}} {{#zcl_commands_source_server}} static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType & value); {{/zcl_commands_source_server}} diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h index 9fc467b2e032d2..5c7d8f195de51d 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h @@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -51,6 +52,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -67,6 +69,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -89,6 +92,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -103,6 +107,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -118,6 +123,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -135,6 +141,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -168,6 +175,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -178,10 +186,13 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestBinaryInputBasic : CHIPBinaryInputBasic +- (void)writeAttributePolarityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeStatusFlagsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeApplicationTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -195,6 +206,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -209,6 +221,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -225,6 +238,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -254,6 +268,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -272,6 +287,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -329,6 +345,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -343,6 +360,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -360,6 +378,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -373,6 +392,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -386,6 +407,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeLockTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeActuatorEnabledWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeDoorStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeNumberOfLogRecordsSupportedWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeNumberOfTotalUsersSupportedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeNumberOfPINUsersSupportedWithValue:(NSNumber * _Nonnull)value @@ -402,11 +425,16 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeMinPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeMaxRFIDCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeMinRFIDCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeCredentialRulesSupportWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeSupportedOperatingModesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDefaultConfigurationRegisterWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -418,7 +446,70 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestElectricalMeasurement : CHIPElectricalMeasurement - (void)writeAttributeMeasurementTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcPowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcPowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcVoltageMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcVoltageDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcCurrentMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcCurrentDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcPowerMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeDcPowerDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcFrequencyMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcFrequencyMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeNeutralCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeTotalActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeTotalReactivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeTotalApparentPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasured1stHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasured3rdHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasured5thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasured7thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasured9thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasured11thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasuredPhase1stHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasuredPhase3rdHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasuredPhase5thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasuredPhase7thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasuredPhase9thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMeasuredPhase11thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcFrequencyMultiplierWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcFrequencyDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePowerMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePowerDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeHarmonicCurrentMultiplierWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePhaseHarmonicCurrentMultiplierWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeInstantaneousVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeInstantaneousLineCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeInstantaneousActiveCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeInstantaneousReactiveCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeInstantaneousPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeRmsVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeRmsVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeRmsVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -428,9 +519,101 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeActivePowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeActivePowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeReactivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeApparentPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePowerFactorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcVoltageMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcVoltageDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcCurrentMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcCurrentDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcPowerMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcPowerDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeVoltageOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeCurrentOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcVoltageOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcCurrentOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcActivePowerOverloadWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcReactivePowerOverloadWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsOverVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsUnderVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsExtremeOverVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsExtremeUnderVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageSagWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageSwellWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLineCurrentPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActiveCurrentPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeReactiveCurrentPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltagePhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageMinPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageMaxPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsCurrentPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsCurrentMinPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsCurrentMaxPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActivePowerPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActivePowerMinPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActivePowerMaxPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeReactivePowerPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeApparentPowerPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePowerFactorPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsOverVoltageCounterPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsUnderVoltageCounterPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsExtremeOverVoltagePeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsExtremeUnderVoltagePeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageSagPeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageSwellPeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLineCurrentPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActiveCurrentPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeReactiveCurrentPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltagePhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageMinPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageMaxPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsCurrentPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsCurrentMinPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsCurrentMaxPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActivePowerPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActivePowerMinPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActivePowerMaxPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeReactivePowerPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeApparentPowerPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePowerFactorPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsOverVoltageCounterPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAverageRmsUnderVoltageCounterPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsExtremeOverVoltagePeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsExtremeUnderVoltagePeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageSagPeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeRmsVoltageSwellPeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -487,6 +670,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -504,6 +688,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -523,6 +708,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -545,6 +731,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -562,6 +749,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -576,6 +764,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -590,6 +779,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -608,6 +798,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -621,6 +812,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -655,6 +847,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeSupportedLocalesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -668,6 +862,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -683,6 +878,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -704,6 +900,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -744,6 +941,7 @@ NS_ASSUME_NONNULL_BEGIN completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -755,7 +953,10 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestOtaSoftwareUpdateProvider : CHIPOtaSoftwareUpdateProvider +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -770,7 +971,10 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeUpdateStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeUpdateStateProgressWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -788,6 +992,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -818,6 +1023,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -838,6 +1044,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -913,6 +1120,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -932,7 +1140,10 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeMaxScaledValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeScaledToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeScaleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -986,6 +1197,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1001,9 +1213,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeCurrentGroupWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeSceneValidWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLastConfiguredByWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1055,6 +1269,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1069,7 +1284,10 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1083,6 +1301,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1094,6 +1313,8 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestThermostat : CHIPThermostat - (void)writeAttributeLocalTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeOutdoorTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeOccupancyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAbsMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAbsMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value @@ -1102,11 +1323,27 @@ NS_ASSUME_NONNULL_BEGIN completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAbsMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePiCoolingDemandWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePiHeatingDemandWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAlarmMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeThermostatRunningModeWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeStartOfWeekWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeNumberOfWeeklyTransitionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeNumberOfDailyTransitionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeThermostatRunningStateWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSetpointChangeSourceWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSetpointChangeAmountWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeSetpointChangeSourceTimestampWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcCoilTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -1122,6 +1359,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1227,6 +1465,8 @@ NS_ASSUME_NONNULL_BEGIN completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1237,6 +1477,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestUnitLocalization : CHIPUnitLocalization +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -1251,6 +1493,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1265,6 +1509,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1307,10 +1552,18 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestWindowCovering : CHIPWindowCovering - (void)writeAttributeTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePhysicalClosedLimitLiftWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributePhysicalClosedLimitTiltWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeNumberOfActuationsLiftWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeNumberOfActuationsTiltWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeConfigStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm index 232c79cf5641b1..2f1f889320653f 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -219,6 +219,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AccessControl::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -367,6 +385,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AccountLogin::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -569,6 +605,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AdministratorCommissioning::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -885,6 +939,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ApplicationBasic::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -1072,6 +1144,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ApplicationLauncher::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -1281,6 +1371,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AudioOutput::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -1501,6 +1609,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BarrierControl::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -1959,6 +2085,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Basic::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -1990,6 +2134,24 @@ @implementation CHIPTestBinaryInputBasic return &_cppCluster; } +- (void)writeAttributePolarityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BinaryInputBasic::Attributes::Polarity::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeStatusFlagsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -2008,6 +2170,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeApplicationTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BinaryInputBasic::Attributes::ApplicationType::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -2125,6 +2305,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BinaryInputBasic::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -2273,6 +2471,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Binding::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -2439,6 +2655,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BooleanState::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -2718,6 +2952,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BridgedActions::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -3120,6 +3372,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BridgedDeviceBasic::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -3391,7 +3661,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -3400,7 +3670,25 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = Channel::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); @@ -4244,6 +4532,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ColorControl::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -4431,6 +4737,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ContentLauncher::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -4736,6 +5060,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Descriptor::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -4884,6 +5226,42 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = DiagnosticLogs::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = DiagnosticLogs::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + @end @interface CHIPTestDoorLock () @@ -4979,6 +5357,25 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeNumberOfLogRecordsSupportedWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = DoorLock::Attributes::NumberOfLogRecordsSupported::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeNumberOfTotalUsersSupportedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { @@ -5165,6 +5562,25 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeCredentialRulesSupportWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = DoorLock::Attributes::CredentialRulesSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeSupportedOperatingModesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { @@ -5184,6 +5600,25 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeDefaultConfigurationRegisterWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = DoorLock::Attributes::DefaultConfigurationRegister::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedShortValue); + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -5301,6 +5736,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = DoorLock::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -5350,7 +5803,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeTotalActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5359,16 +5812,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltage::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.intValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRmsVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5377,16 +5830,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMin::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRmsVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5395,16 +5848,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMax::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRmsVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5413,16 +5866,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRmsCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5431,16 +5884,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMin::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRmsCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5449,16 +5902,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMax::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRmsCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5467,16 +5920,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcPower::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcPowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5485,7 +5938,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePower::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMin::TypeInfo; TypeInfo::Type cppValue; cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); @@ -5494,7 +5947,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeActivePowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcPowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5503,7 +5956,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMax::TypeInfo; TypeInfo::Type cppValue; cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); @@ -5512,7 +5965,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeActivePowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcVoltageMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5521,16 +5974,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMultiplier::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcVoltageDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5539,37 +5992,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageDivisor::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcCurrentMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5578,37 +6010,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMultiplier::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcCurrentDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5617,37 +6028,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::AttributeList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentDivisor::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcPowerMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5656,7 +6046,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMultiplier::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); @@ -5665,20 +6055,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -@end - -@interface CHIPTestEthernetNetworkDiagnostics () -@property (readonly) chip::Controller::EthernetNetworkDiagnosticsClusterTest cppCluster; -@end - -@implementation CHIPTestEthernetNetworkDiagnostics - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributePHYRateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDcPowerDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5687,21 +6064,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerDivisor::TypeInfo; TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = static_cast>(value.unsignedCharValue); - } + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeFullDuplexWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5710,21 +6082,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequency::TypeInfo; TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.boolValue; - } + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributePacketRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcFrequencyMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5733,16 +6100,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMin::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributePacketTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcFrequencyMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5751,16 +6118,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMax::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeTxErrCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeNeutralCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5769,16 +6136,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::NeutralCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeCollisionCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeTotalActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5787,16 +6154,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.intValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeTotalReactivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5805,16 +6172,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::TotalReactivePower::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.intValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeCarrierDetectWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeTotalApparentPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5823,21 +6190,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::TotalApparentPower::TypeInfo; TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.boolValue; - } + cppValue = value.unsignedIntValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeTimeSinceResetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasured1stHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5846,16 +6209,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasured3rdHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5864,37 +6228,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasured5thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5903,37 +6247,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasured7thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5942,37 +6266,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::AttributeList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasured9thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5981,16 +6285,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasured11thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -5999,29 +6304,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -@end - -@interface CHIPTestFanControl () -@property (readonly) chip::Controller::FanControlClusterTest cppCluster; -@end - -@implementation CHIPTestFanControl - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredPhase1stHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6030,16 +6323,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredPhase3rdHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6048,16 +6342,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredPhase5thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6066,16 +6361,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredPhase7thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6084,16 +6380,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredPhase9thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6102,16 +6399,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeMeasuredPhase11thHarmonicCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6120,37 +6418,17 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcFrequencyMultiplierWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -6159,14 +6437,2209 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = FanControl::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMultiplier::TypeInfo; TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcFrequencyDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyDivisor::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePowerMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::PowerMultiplier::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePowerDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::PowerDivisor::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeHarmonicCurrentMultiplierWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.charValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePhaseHarmonicCurrentMultiplierWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.charValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeInstantaneousVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeInstantaneousLineCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousLineCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeInstantaneousActiveCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeInstantaneousReactiveCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeInstantaneousPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousPower::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePower::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeReactivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ReactivePower::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeApparentPowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ApparentPower::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePowerFactorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::PowerFactor::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.charValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcVoltageMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageMultiplier::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcVoltageDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageDivisor::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcCurrentMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentMultiplier::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcCurrentDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentDivisor::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcPowerMultiplierWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcPowerMultiplier::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcPowerDivisorWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcPowerDivisor::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeVoltageOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::VoltageOverload::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeCurrentOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::CurrentOverload::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcVoltageOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageOverload::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcCurrentOverloadWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentOverload::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcActivePowerOverloadWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcActivePowerOverload::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcReactivePowerOverloadWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcReactivePowerOverload::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsOverVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsUnderVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsExtremeOverVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsExtremeUnderVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageSagWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSag::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageSwellWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwell::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLineCurrentPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::LineCurrentPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActiveCurrentPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeReactiveCurrentPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltagePhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltagePhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageMinPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageMaxPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentMinPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentMaxPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerMinPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerMaxPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeReactivePowerPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ReactivePowerPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeApparentPowerPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ApparentPowerPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePowerFactorPhaseBWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::PowerFactorPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.charValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsOverVoltageCounterPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsUnderVoltageCounterPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsExtremeOverVoltagePeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsExtremeUnderVoltagePeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageSagPeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageSwellPeriodPhaseBWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLineCurrentPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::LineCurrentPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActiveCurrentPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeReactiveCurrentPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltagePhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltagePhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageMinPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageMaxPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentMinPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsCurrentMaxPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerMinPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActivePowerMaxPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeReactivePowerPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ReactivePowerPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeApparentPowerPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ApparentPowerPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePowerFactorPhaseCWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::PowerFactorPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.charValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsOverVoltageCounterPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAverageRmsUnderVoltageCounterPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsExtremeOverVoltagePeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsExtremeUnderVoltagePeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageSagPeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRmsVoltageSwellPeriodPhaseCWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::AttributeList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + +@interface CHIPTestEthernetNetworkDiagnostics () +@property (readonly) chip::Controller::EthernetNetworkDiagnosticsClusterTest cppCluster; +@end + +@implementation CHIPTestEthernetNetworkDiagnostics + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributePHYRateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>(value.unsignedCharValue); + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeFullDuplexWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.boolValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePacketRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePacketTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeTxErrCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeCollisionCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeCarrierDetectWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.boolValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeTimeSinceResetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::AttributeList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + +@interface CHIPTestFanControl () +@property (readonly) chip::Controller::FanControlClusterTest cppCluster; +@end + +@implementation CHIPTestFanControl + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributePercentCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSpeedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeRockSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWindSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FanControl::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } listFreer.add(listHolder_0); @@ -6434,6 +8907,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FixedLabel::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -6669,6 +9160,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = FlowMeasurement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -6891,6 +9400,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GeneralCommissioning::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -7331,6 +9858,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GeneralDiagnostics::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -7582,6 +10127,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GroupKeyManagement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -7748,6 +10311,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Groups::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -7914,6 +10495,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Identify::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -8172,6 +10771,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = IlluminanceMeasurement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -8320,6 +10937,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = KeypadInput::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -8760,6 +11395,63 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = LocalizationConfiguration::Attributes::AttributeList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = LocalizationConfiguration::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -8908,6 +11600,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = LowPower::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -9118,6 +11828,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = MediaInput::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -9424,6 +12152,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = MediaPlayback::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -9887,7 +12633,46 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = NetworkCommissioning::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9896,7 +12681,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = NetworkCommissioning::Attributes::AcceptedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -9926,7 +12711,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -9935,7 +12720,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = NetworkCommissioning::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = NetworkCommissioning::Attributes::AttributeList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -10014,6 +12799,84 @@ @implementation CHIPTestOtaSoftwareUpdateProvider return &_cppCluster; } +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateProvider::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateProvider::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -10053,6 +12916,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateProvider::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -10143,6 +13024,84 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -10182,6 +13141,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -10385,6 +13362,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OccupancySensing::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -10753,6 +13748,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OnOffSwitchConfiguration::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11085,6 +14098,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OperationalCredentials::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -12073,6 +15104,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSourceConfiguration::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -12296,6 +15345,84 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PressureMeasurement::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PressureMeasurement::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -12335,6 +15462,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PressureMeasurement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -13177,6 +16322,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = RelativeHumidityMeasurement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -13298,6 +16461,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeLastConfiguredByWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Scenes::Attributes::LastConfiguredBy::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -13415,6 +16596,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Scenes::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -14105,6 +17304,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TargetNavigator::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -14223,6 +17440,84 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TemperatureMeasurement::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TemperatureMeasurement::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -14262,6 +17557,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TemperatureMeasurement::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -14410,6 +17723,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TestCluster::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -14459,6 +17790,42 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeOutdoorTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::OutdoorTemperature::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeOccupancyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::Occupancy::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAbsMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { @@ -14507,7 +17874,210 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; + using TypeInfo = Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAbsMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.shortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePiCoolingDemandWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::PiCoolingDemand::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePiHeatingDemandWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::PiHeatingDemand::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAlarmMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::AlarmMask::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeThermostatRunningModeWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::ThermostatRunningMode::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeStartOfWeekWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::StartOfWeek::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeNumberOfWeeklyTransitionsWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeNumberOfDailyTransitionsWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeThermostatRunningStateWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::ThermostatRunningState::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSetpointChangeSourceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::SetpointChangeSource::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeSetpointChangeAmountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::SetpointChangeAmount::TypeInfo; TypeInfo::Type cppValue; cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); @@ -14516,8 +18086,8 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeAbsMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeSetpointChangeSourceTimestampWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -14526,16 +18096,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + using TypeInfo = Thermostat::Attributes::SetpointChangeSourceTimestamp::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.shortValue; + cppValue = value.unsignedIntValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeStartOfWeekWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcCoilTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -14544,17 +18114,16 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::StartOfWeek::TypeInfo; + using TypeInfo = Thermostat::Attributes::AcCoilTemperature::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.shortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeNumberOfWeeklyTransitionsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -14563,17 +18132,37 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; + using TypeInfo = Thermostat::Attributes::GeneratedCommandList::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeNumberOfDailyTransitionsWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -14582,9 +18171,30 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; + using TypeInfo = Thermostat::Attributes::AcceptedCommandList::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -14796,6 +18406,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -16072,8 +19700,183 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeActiveNetworkFaultsListWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeActiveNetworkFaultsListWithValue:(NSArray * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] + = static_castmList[i_0])>>(element_0.unsignedCharValue); + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttributeList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16082,7 +19885,39 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::TypeInfo; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + +@interface CHIPTestTimeFormatLocalization () +@property (readonly) chip::Controller::TimeFormatLocalizationClusterTest cppCluster; +@end + +@implementation CHIPTestTimeFormatLocalization + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributeSupportedCalendarTypesWithValue:(NSArray * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TimeFormatLocalization::Attributes::SupportedCalendarTypes::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16122,7 +19957,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = TimeFormatLocalization::Attributes::GeneratedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16161,7 +19996,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = TimeFormatLocalization::Attributes::AcceptedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16200,7 +20035,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttributeList::TypeInfo; + using TypeInfo = TimeFormatLocalization::Attributes::AttributeList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16239,7 +20074,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + using TypeInfo = TimeFormatLocalization::Attributes::FeatureMap::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; auto successFn = Callback::FromCancelable(success); @@ -16257,7 +20092,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = TimeFormatLocalization::Attributes::ClusterRevision::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); @@ -16268,19 +20103,18 @@ new CHIPDefaultSuccessCallbackBridge( @end -@interface CHIPTestTimeFormatLocalization () -@property (readonly) chip::Controller::TimeFormatLocalizationClusterTest cppCluster; +@interface CHIPTestUnitLocalization () +@property (readonly) chip::Controller::UnitLocalizationClusterTest cppCluster; @end -@implementation CHIPTestTimeFormatLocalization +@implementation CHIPTestUnitLocalization - (chip::Controller::ClusterBase *)getCluster { return &_cppCluster; } -- (void)writeAttributeSupportedCalendarTypesWithValue:(NSArray * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16289,7 +20123,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::SupportedCalendarTypes::TypeInfo; + using TypeInfo = UnitLocalization::Attributes::GeneratedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16306,8 +20140,7 @@ new CHIPDefaultSuccessCallbackBridge( return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] - = static_castmList[i_0])>>(element_0.unsignedCharValue); + listHolder_0->mList[i_0] = element_0.unsignedIntValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -16320,7 +20153,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16329,7 +20162,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = UnitLocalization::Attributes::AcceptedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16359,7 +20192,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16368,7 +20201,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = UnitLocalization::Attributes::AttributeList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16398,6 +20231,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = UnitLocalization::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -16407,7 +20258,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = TimeFormatLocalization::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = UnitLocalization::Attributes::ClusterRevision::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); @@ -16418,18 +20269,18 @@ new CHIPDefaultSuccessCallbackBridge( @end -@interface CHIPTestUnitLocalization () -@property (readonly) chip::Controller::UnitLocalizationClusterTest cppCluster; +@interface CHIPTestUserLabel () +@property (readonly) chip::Controller::UserLabelClusterTest cppCluster; @end -@implementation CHIPTestUnitLocalization +@implementation CHIPTestUserLabel - (chip::Controller::ClusterBase *)getCluster { return &_cppCluster; } -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16438,7 +20289,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = UnitLocalization::Attributes::AttributeList::TypeInfo; + using TypeInfo = UserLabel::Attributes::GeneratedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16468,56 +20319,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UnitLocalization::Attributes::FeatureMap::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UnitLocalization::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - -@interface CHIPTestUserLabel () -@property (readonly) chip::Controller::UserLabelClusterTest cppCluster; -@end - -@implementation CHIPTestUserLabel - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16526,7 +20328,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = UserLabel::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = UserLabel::Attributes::AcceptedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16556,7 +20358,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -16565,7 +20367,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = UserLabel::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = UserLabel::Attributes::AttributeList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -16595,6 +20397,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = UserLabel::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -16761,6 +20581,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = WakeOnLan::Attributes::FeatureMap::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -17237,6 +21075,44 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributePhysicalClosedLimitLiftWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = WindowCovering::Attributes::PhysicalClosedLimitLift::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePhysicalClosedLimitTiltWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = WindowCovering::Attributes::PhysicalClosedLimitTilt::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -17283,6 +21159,44 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeNumberOfActuationsLiftWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = WindowCovering::Attributes::NumberOfActuationsLift::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeNumberOfActuationsTiltWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = WindowCovering::Attributes::NumberOfActuationsTilt::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeConfigStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h index d131e0857c9b2f..3daf45d7bc303a 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -905,6 +905,76 @@ class SubscribeAttributeAccessControlAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadAccessControlFeatureMap : public ReadAttribute { +public: + ReadAccessControlFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadAccessControlFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAccessControl * cluster = [[CHIPAccessControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AccessControl.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "AccessControl FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeAccessControlFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeAccessControlFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeAccessControlFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAccessControl * cluster = [[CHIPAccessControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AccessControl.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -1001,6 +1071,7 @@ class AccountLoginGetSetupPIN : public ClusterCommand { AccountLoginGetSetupPIN() : ClusterCommand("get-setup-pin") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); ClusterCommand::AddArguments(); } @@ -1040,6 +1111,7 @@ class AccountLoginGetSetupPIN : public ClusterCommand { } private: + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type mRequest; chip::ByteSpan mTempAccountIdentifier; }; @@ -1051,6 +1123,7 @@ class AccountLoginLogin : public ClusterCommand { AccountLoginLogin() : ClusterCommand("login") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); AddArgument("SetupPIN", &mSetupPIN); ClusterCommand::AddArguments(); @@ -1090,6 +1163,7 @@ class AccountLoginLogin : public ClusterCommand { } private: + chip::app::Clusters::AccountLogin::Commands::Login::Type mRequest; chip::ByteSpan mTempAccountIdentifier; chip::ByteSpan mSetupPIN; }; @@ -1102,6 +1176,7 @@ class AccountLoginLogout : public ClusterCommand { AccountLoginLogout() : ClusterCommand("logout") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } @@ -1134,6 +1209,7 @@ class AccountLoginLogout : public ClusterCommand { } private: + chip::app::Clusters::AccountLogin::Commands::Logout::Type mRequest; }; /* @@ -1348,6 +1424,76 @@ class SubscribeAttributeAccountLoginAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadAccountLoginFeatureMap : public ReadAttribute { +public: + ReadAccountLoginFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadAccountLoginFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050E) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AccountLogin.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "AccountLogin FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeAccountLoginFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeAccountLoginFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeAccountLoginFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050E) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AccountLogin.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -1439,54 +1585,6 @@ class SubscribeAttributeAccountLoginClusterRevision : public SubscribeAttribute | Events: | | \*----------------------------------------------------------------------------*/ -/* - * Command OpenBasicCommissioningWindow - */ -class AdministratorCommissioningOpenBasicCommissioningWindow : public ClusterCommand { -public: - AdministratorCommissioningOpenBasicCommissioningWindow() - : ClusterCommand("open-basic-commissioning-window") - { - AddArgument("CommissioningTimeout", 0, UINT16_MAX, &mCommissioningTimeout); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.commissioningTimeout = [NSNumber numberWithUnsignedShort:mCommissioningTimeout]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster openBasicCommissioningWindowWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint16_t mCommissioningTimeout; -}; - /* * Command OpenCommissioningWindow */ @@ -1495,6 +1593,7 @@ class AdministratorCommissioningOpenCommissioningWindow : public ClusterCommand AdministratorCommissioningOpenCommissioningWindow() : ClusterCommand("open-commissioning-window") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("CommissioningTimeout", 0, UINT16_MAX, &mCommissioningTimeout); AddArgument("PAKEVerifier", &mPAKEVerifier); AddArgument("Discriminator", 0, UINT16_MAX, &mDiscriminator); @@ -1540,6 +1639,7 @@ class AdministratorCommissioningOpenCommissioningWindow : public ClusterCommand } private: + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type mRequest; uint16_t mCommissioningTimeout; chip::ByteSpan mPAKEVerifier; uint16_t mDiscriminator; @@ -1547,6 +1647,56 @@ class AdministratorCommissioningOpenCommissioningWindow : public ClusterCommand chip::ByteSpan mSalt; }; +/* + * Command OpenBasicCommissioningWindow + */ +class AdministratorCommissioningOpenBasicCommissioningWindow : public ClusterCommand { +public: + AdministratorCommissioningOpenBasicCommissioningWindow() + : ClusterCommand("open-basic-commissioning-window") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("CommissioningTimeout", 0, UINT16_MAX, &mCommissioningTimeout); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003C) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:mCommissioningTimeout]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type mRequest; + uint16_t mCommissioningTimeout; +}; + /* * Command RevokeCommissioning */ @@ -1555,6 +1705,7 @@ class AdministratorCommissioningRevokeCommissioning : public ClusterCommand { AdministratorCommissioningRevokeCommissioning() : ClusterCommand("revoke-commissioning") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } @@ -1589,6 +1740,7 @@ class AdministratorCommissioningRevokeCommissioning : public ClusterCommand { } private: + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type mRequest; }; /* @@ -2041,6 +2193,80 @@ class SubscribeAttributeAdministratorCommissioningAttributeList : public Subscri } }; +/* + * Attribute FeatureMap + */ +class ReadAdministratorCommissioningFeatureMap : public ReadAttribute { +public: + ReadAdministratorCommissioningFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadAdministratorCommissioningFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AdministratorCommissioning.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "AdministratorCommissioning FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeAdministratorCommissioningFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeAdministratorCommissioningFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeAdministratorCommissioningFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AdministratorCommissioning.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -2960,6 +3186,80 @@ class SubscribeAttributeApplicationBasicAttributeList : public SubscribeAttribut } }; +/* + * Attribute FeatureMap + */ +class ReadApplicationBasicFeatureMap : public ReadAttribute { +public: + ReadApplicationBasicFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadApplicationBasicFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ApplicationBasic.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ApplicationBasic FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeApplicationBasicFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeApplicationBasicFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeApplicationBasicFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ApplicationBasic.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -3055,28 +3355,30 @@ class SubscribeAttributeApplicationBasicClusterRevision : public SubscribeAttrib \*----------------------------------------------------------------------------*/ /* - * Command HideApp + * Command LaunchApp */ -class ApplicationLauncherHideApp : public ClusterCommand { +class ApplicationLauncherLaunchApp : public ClusterCommand { public: - ApplicationLauncherHideApp() - : ClusterCommand("hide-app") + ApplicationLauncherLaunchApp() + : ClusterCommand("launch-app") , mComplex_Application(&mRequest.application) { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Application", &mComplex_Application); + AddArgument("Data", &mData); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPApplicationLauncherClusterHideAppParams alloc] init]; + __auto_type * params = [[CHIPApplicationLauncherClusterLaunchAppParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.application = [CHIPApplicationLauncherClusterApplication new]; @@ -3084,56 +3386,60 @@ class ApplicationLauncherHideApp : public ClusterCommand { params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() length:mRequest.application.applicationId.size() encoding:NSUTF8StringEncoding]; + if (mData.HasValue()) { + params.data = [[NSData alloc] initWithBytes:mData.Value().data() length:mData.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster hideAppWithParams:params - completionHandler:^( - CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster launchAppWithParams:params + completionHandler:^( + CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; TypedComplexArgument mComplex_Application; + chip::Optional mData; }; /* - * Command LaunchApp + * Command StopApp */ -class ApplicationLauncherLaunchApp : public ClusterCommand { +class ApplicationLauncherStopApp : public ClusterCommand { public: - ApplicationLauncherLaunchApp() - : ClusterCommand("launch-app") + ApplicationLauncherStopApp() + : ClusterCommand("stop-app") , mComplex_Application(&mRequest.application) { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Application", &mComplex_Application); - AddArgument("Data", &mData); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPApplicationLauncherClusterLaunchAppParams alloc] init]; + __auto_type * params = [[CHIPApplicationLauncherClusterStopAppParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.application = [CHIPApplicationLauncherClusterApplication new]; @@ -3141,59 +3447,56 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() length:mRequest.application.applicationId.size() encoding:NSUTF8StringEncoding]; - if (mData.HasValue()) { - params.data = [[NSData alloc] initWithBytes:mData.Value().data() length:mData.Value().size()]; - } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchAppWithParams:params - completionHandler:^( - CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster stopAppWithParams:params + completionHandler:^( + CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; TypedComplexArgument mComplex_Application; - chip::Optional mData; }; /* - * Command StopApp + * Command HideApp */ -class ApplicationLauncherStopApp : public ClusterCommand { +class ApplicationLauncherHideApp : public ClusterCommand { public: - ApplicationLauncherStopApp() - : ClusterCommand("stop-app") + ApplicationLauncherHideApp() + : ClusterCommand("hide-app") , mComplex_Application(&mRequest.application) { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Application", &mComplex_Application); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPApplicationLauncherClusterStopAppParams alloc] init]; + __auto_type * params = [[CHIPApplicationLauncherClusterHideAppParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.application = [CHIPApplicationLauncherClusterApplication new]; @@ -3204,7 +3507,7 @@ class ApplicationLauncherStopApp : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopAppWithParams:params + [cluster hideAppWithParams:params completionHandler:^( CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); @@ -3223,7 +3526,7 @@ class ApplicationLauncherStopApp : public ClusterCommand { } private: - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; TypedComplexArgument mComplex_Application; }; @@ -3661,6 +3964,80 @@ class SubscribeAttributeApplicationLauncherAttributeList : public SubscribeAttri } }; +/* + * Attribute FeatureMap + */ +class ReadApplicationLauncherFeatureMap : public ReadAttribute { +public: + ReadApplicationLauncherFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadApplicationLauncherFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ApplicationLauncher.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ApplicationLauncher FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeApplicationLauncherFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeApplicationLauncherFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeApplicationLauncherFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ApplicationLauncher.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -3756,34 +4133,33 @@ class SubscribeAttributeApplicationLauncherClusterRevision : public SubscribeAtt \*----------------------------------------------------------------------------*/ /* - * Command RenameOutput + * Command SelectOutput */ -class AudioOutputRenameOutput : public ClusterCommand { +class AudioOutputSelectOutput : public ClusterCommand { public: - AudioOutputRenameOutput() - : ClusterCommand("rename-output") + AudioOutputSelectOutput() + : ClusterCommand("select-output") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Index", 0, UINT8_MAX, &mIndex); - AddArgument("Name", &mName); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050B) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPAudioOutputClusterRenameOutputParams alloc] init]; + __auto_type * params = [[CHIPAudioOutputClusterSelectOutputParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.index = [NSNumber numberWithUnsignedChar:mIndex]; - params.name = [[NSString alloc] initWithBytes:mName.data() length:mName.size() encoding:NSUTF8StringEncoding]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster renameOutputWithParams:params + [cluster selectOutputWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -3800,37 +4176,40 @@ class AudioOutputRenameOutput : public ClusterCommand { } private: + chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type mRequest; uint8_t mIndex; - chip::ByteSpan mName; }; /* - * Command SelectOutput + * Command RenameOutput */ -class AudioOutputSelectOutput : public ClusterCommand { +class AudioOutputRenameOutput : public ClusterCommand { public: - AudioOutputSelectOutput() - : ClusterCommand("select-output") + AudioOutputRenameOutput() + : ClusterCommand("rename-output") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Index", 0, UINT8_MAX, &mIndex); + AddArgument("Name", &mName); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050B) command (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPAudioOutputClusterSelectOutputParams alloc] init]; + __auto_type * params = [[CHIPAudioOutputClusterRenameOutputParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.index = [NSNumber numberWithUnsignedChar:mIndex]; + params.name = [[NSString alloc] initWithBytes:mName.data() length:mName.size() encoding:NSUTF8StringEncoding]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster selectOutputWithParams:params + [cluster renameOutputWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -3847,7 +4226,9 @@ class AudioOutputSelectOutput : public ClusterCommand { } private: + chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type mRequest; uint8_t mIndex; + chip::ByteSpan mName; }; /* @@ -4202,6 +4583,76 @@ class SubscribeAttributeAudioOutputAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadAudioOutputFeatureMap : public ReadAttribute { +public: + ReadAudioOutputFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadAudioOutputFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AudioOutput.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "AudioOutput FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeAudioOutputFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeAudioOutputFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeAudioOutputFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"AudioOutput.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -4307,6 +4758,7 @@ class BarrierControlBarrierControlGoToPercent : public ClusterCommand { BarrierControlBarrierControlGoToPercent() : ClusterCommand("barrier-control-go-to-percent") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("PercentOpen", 0, UINT8_MAX, &mPercentOpen); ClusterCommand::AddArguments(); } @@ -4342,6 +4794,7 @@ class BarrierControlBarrierControlGoToPercent : public ClusterCommand { } private: + chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Type mRequest; uint8_t mPercentOpen; }; @@ -4353,6 +4806,7 @@ class BarrierControlBarrierControlStop : public ClusterCommand { BarrierControlBarrierControlStop() : ClusterCommand("barrier-control-stop") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } @@ -4385,6 +4839,7 @@ class BarrierControlBarrierControlStop : public ClusterCommand { } private: + chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Type mRequest; }; /* @@ -4601,30 +5056,30 @@ class SubscribeAttributeBarrierControlBarrierCapabilities : public SubscribeAttr }; /* - * Attribute BarrierPosition + * Attribute BarrierOpenEvents */ -class ReadBarrierControlBarrierPosition : public ReadAttribute { +class ReadBarrierControlBarrierOpenEvents : public ReadAttribute { public: - ReadBarrierControlBarrierPosition() - : ReadAttribute("barrier-position") + ReadBarrierControlBarrierOpenEvents() + : ReadAttribute("barrier-open-events") { } - ~ReadBarrierControlBarrierPosition() {} + ~ReadBarrierControlBarrierOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBarrierPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); + [cluster readAttributeBarrierOpenEventsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierOpenEvents response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BarrierControl BarrierPosition read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl BarrierOpenEvents read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -4632,34 +5087,75 @@ class ReadBarrierControlBarrierPosition : public ReadAttribute { } }; -class SubscribeAttributeBarrierControlBarrierPosition : public SubscribeAttribute { +class WriteBarrierControlBarrierOpenEvents : public WriteAttribute { public: - SubscribeAttributeBarrierControlBarrierPosition() - : SubscribeAttribute("barrier-position") + WriteBarrierControlBarrierOpenEvents() + : WriteAttribute("barrier-open-events") { + AddArgument("attr-name", "barrier-open-events"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBarrierControlBarrierPosition() {} + ~WriteBarrierControlBarrierOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) WriteAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeBarrierOpenEventsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierOpenEvents write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeBarrierControlBarrierOpenEvents : public SubscribeAttribute { +public: + SubscribeAttributeBarrierControlBarrierOpenEvents() + : SubscribeAttribute("barrier-open-events") + { + } + + ~SubscribeAttributeBarrierControlBarrierOpenEvents() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBarrierPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeBarrierOpenEventsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierOpenEvents response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -4671,30 +5167,30 @@ class SubscribeAttributeBarrierControlBarrierPosition : public SubscribeAttribut }; /* - * Attribute GeneratedCommandList + * Attribute BarrierCloseEvents */ -class ReadBarrierControlGeneratedCommandList : public ReadAttribute { +class ReadBarrierControlBarrierCloseEvents : public ReadAttribute { public: - ReadBarrierControlGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadBarrierControlBarrierCloseEvents() + : ReadAttribute("barrier-close-events") { } - ~ReadBarrierControlGeneratedCommandList() {} + ~ReadBarrierControlBarrierCloseEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.GeneratedCommandList response %@", [value description]); + [cluster readAttributeBarrierCloseEventsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierCloseEvents response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BarrierControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl BarrierCloseEvents read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -4702,35 +5198,75 @@ class ReadBarrierControlGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBarrierControlGeneratedCommandList : public SubscribeAttribute { +class WriteBarrierControlBarrierCloseEvents : public WriteAttribute { public: - SubscribeAttributeBarrierControlGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteBarrierControlBarrierCloseEvents() + : WriteAttribute("barrier-close-events") { + AddArgument("attr-name", "barrier-close-events"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBarrierControlGeneratedCommandList() {} + ~WriteBarrierControlBarrierCloseEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) WriteAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeBarrierCloseEventsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierCloseEvents write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeBarrierControlBarrierCloseEvents : public SubscribeAttribute { +public: + SubscribeAttributeBarrierControlBarrierCloseEvents() + : SubscribeAttribute("barrier-close-events") + { + } + + ~SubscribeAttributeBarrierControlBarrierCloseEvents() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeBarrierCloseEventsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierCloseEvents response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -4742,61 +5278,104 @@ class SubscribeAttributeBarrierControlGeneratedCommandList : public SubscribeAtt }; /* - * Attribute AcceptedCommandList + * Attribute BarrierCommandOpenEvents */ -class ReadBarrierControlAcceptedCommandList : public ReadAttribute { +class ReadBarrierControlBarrierCommandOpenEvents : public ReadAttribute { public: - ReadBarrierControlAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadBarrierControlBarrierCommandOpenEvents() + : ReadAttribute("barrier-command-open-events") { } - ~ReadBarrierControlAcceptedCommandList() {} + ~ReadBarrierControlBarrierCommandOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.AcceptedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeBarrierCommandOpenEventsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierCommandOpenEvents response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "BarrierControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierCommandOpenEvents read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeBarrierControlAcceptedCommandList : public SubscribeAttribute { +class WriteBarrierControlBarrierCommandOpenEvents : public WriteAttribute { public: - SubscribeAttributeBarrierControlAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteBarrierControlBarrierCommandOpenEvents() + : WriteAttribute("barrier-command-open-events") { + AddArgument("attr-name", "barrier-command-open-events"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBarrierControlAcceptedCommandList() {} + ~WriteBarrierControlBarrierCommandOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) WriteAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeBarrierCommandOpenEventsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierCommandOpenEvents write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeBarrierControlBarrierCommandOpenEvents : public SubscribeAttribute { +public: + SubscribeAttributeBarrierControlBarrierCommandOpenEvents() + : SubscribeAttribute("barrier-command-open-events") + { + } + + ~SubscribeAttributeBarrierControlBarrierCommandOpenEvents() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster + subscribeAttributeBarrierCommandOpenEventsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.AcceptedCommandList response %@", + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierCommandOpenEvents response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -4813,65 +5392,109 @@ class SubscribeAttributeBarrierControlAcceptedCommandList : public SubscribeAttr }; /* - * Attribute AttributeList + * Attribute BarrierCommandCloseEvents */ -class ReadBarrierControlAttributeList : public ReadAttribute { +class ReadBarrierControlBarrierCommandCloseEvents : public ReadAttribute { public: - ReadBarrierControlAttributeList() - : ReadAttribute("attribute-list") + ReadBarrierControlBarrierCommandCloseEvents() + : ReadAttribute("barrier-command-close-events") { } - ~ReadBarrierControlAttributeList() {} + ~ReadBarrierControlBarrierCommandCloseEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.AttributeList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeBarrierCommandCloseEventsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierCommandCloseEvents response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "BarrierControl AttributeList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierCommandCloseEvents read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeBarrierControlAttributeList : public SubscribeAttribute { +class WriteBarrierControlBarrierCommandCloseEvents : public WriteAttribute { public: - SubscribeAttributeBarrierControlAttributeList() - : SubscribeAttribute("attribute-list") + WriteBarrierControlBarrierCommandCloseEvents() + : WriteAttribute("barrier-command-close-events") { + AddArgument("attr-name", "barrier-command-close-events"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBarrierControlAttributeList() {} + ~WriteBarrierControlBarrierCommandCloseEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) WriteAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeBarrierCommandCloseEventsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "BarrierControl BarrierCommandCloseEvents write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeBarrierControlBarrierCommandCloseEvents : public SubscribeAttribute { +public: + SubscribeAttributeBarrierControlBarrierCommandCloseEvents() + : SubscribeAttribute("barrier-command-close-events") + { + } + + ~SubscribeAttributeBarrierControlBarrierCommandCloseEvents() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeBarrierCommandCloseEventsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierCommandCloseEvents response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -4883,30 +5506,30 @@ class SubscribeAttributeBarrierControlAttributeList : public SubscribeAttribute }; /* - * Attribute ClusterRevision + * Attribute BarrierOpenPeriod */ -class ReadBarrierControlClusterRevision : public ReadAttribute { +class ReadBarrierControlBarrierOpenPeriod : public ReadAttribute { public: - ReadBarrierControlClusterRevision() - : ReadAttribute("cluster-revision") + ReadBarrierControlBarrierOpenPeriod() + : ReadAttribute("barrier-open-period") { } - ~ReadBarrierControlClusterRevision() {} + ~ReadBarrierControlBarrierOpenPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); + [cluster readAttributeBarrierOpenPeriodWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierOpenPeriod response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BarrierControl ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl BarrierOpenPeriod read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -4914,34 +5537,75 @@ class ReadBarrierControlClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeBarrierControlClusterRevision : public SubscribeAttribute { +class WriteBarrierControlBarrierOpenPeriod : public WriteAttribute { public: - SubscribeAttributeBarrierControlClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteBarrierControlBarrierOpenPeriod() + : WriteAttribute("barrier-open-period") { + AddArgument("attr-name", "barrier-open-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBarrierControlClusterRevision() {} + ~WriteBarrierControlBarrierOpenPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) WriteAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeBarrierOpenPeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierOpenPeriod write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeBarrierControlBarrierOpenPeriod : public SubscribeAttribute { +public: + SubscribeAttributeBarrierControlBarrierOpenPeriod() + : SubscribeAttribute("barrier-open-period") + { + } + + ~SubscribeAttributeBarrierControlBarrierOpenPeriod() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeBarrierOpenPeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierOpenPeriod response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -4952,71 +5616,31 @@ class SubscribeAttributeBarrierControlClusterRevision : public SubscribeAttribut } }; -/*----------------------------------------------------------------------------*\ -| Cluster Basic | 0x0028 | -|------------------------------------------------------------------------------| -| Commands: | | -| * MfgSpecificPing | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * DataModelRevision | 0x0000 | -| * VendorName | 0x0001 | -| * VendorID | 0x0002 | -| * ProductName | 0x0003 | -| * ProductID | 0x0004 | -| * NodeLabel | 0x0005 | -| * Location | 0x0006 | -| * HardwareVersion | 0x0007 | -| * HardwareVersionString | 0x0008 | -| * SoftwareVersion | 0x0009 | -| * SoftwareVersionString | 0x000A | -| * ManufacturingDate | 0x000B | -| * PartNumber | 0x000C | -| * ProductURL | 0x000D | -| * ProductLabel | 0x000E | -| * SerialNumber | 0x000F | -| * LocalConfigDisabled | 0x0010 | -| * Reachable | 0x0011 | -| * UniqueID | 0x0012 | -| * CapabilityMinima | 0x0013 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StartUp | 0x0000 | -| * ShutDown | 0x0001 | -| * Leave | 0x0002 | -| * ReachableChanged | 0x0003 | -\*----------------------------------------------------------------------------*/ - /* - * Attribute DataModelRevision + * Attribute BarrierClosePeriod */ -class ReadBasicDataModelRevision : public ReadAttribute { +class ReadBarrierControlBarrierClosePeriod : public ReadAttribute { public: - ReadBasicDataModelRevision() - : ReadAttribute("data-model-revision") + ReadBarrierControlBarrierClosePeriod() + : ReadAttribute("barrier-close-period") { } - ~ReadBasicDataModelRevision() {} + ~ReadBarrierControlBarrierClosePeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.DataModelRevision response %@", [value description]); + [cluster readAttributeBarrierClosePeriodWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierClosePeriod response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic DataModelRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl BarrierClosePeriod read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5024,34 +5648,75 @@ class ReadBasicDataModelRevision : public ReadAttribute { } }; -class SubscribeAttributeBasicDataModelRevision : public SubscribeAttribute { +class WriteBarrierControlBarrierClosePeriod : public WriteAttribute { public: - SubscribeAttributeBasicDataModelRevision() - : SubscribeAttribute("data-model-revision") + WriteBarrierControlBarrierClosePeriod() + : WriteAttribute("barrier-close-period") { + AddArgument("attr-name", "barrier-close-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBasicDataModelRevision() {} + ~WriteBarrierControlBarrierClosePeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) WriteAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeBarrierClosePeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BarrierControl BarrierClosePeriod write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeBarrierControlBarrierClosePeriod : public SubscribeAttribute { +public: + SubscribeAttributeBarrierControlBarrierClosePeriod() + : SubscribeAttribute("barrier-close-period") + { + } + + ~SubscribeAttributeBarrierControlBarrierClosePeriod() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDataModelRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.DataModelRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeBarrierClosePeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierClosePeriod response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5063,30 +5728,30 @@ class SubscribeAttributeBasicDataModelRevision : public SubscribeAttribute { }; /* - * Attribute VendorName + * Attribute BarrierPosition */ -class ReadBasicVendorName : public ReadAttribute { +class ReadBarrierControlBarrierPosition : public ReadAttribute { public: - ReadBasicVendorName() - : ReadAttribute("vendor-name") + ReadBarrierControlBarrierPosition() + : ReadAttribute("barrier-position") { } - ~ReadBasicVendorName() {} + ~ReadBarrierControlBarrierPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000000A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.VendorName response %@", [value description]); + [cluster readAttributeBarrierPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic VendorName read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl BarrierPosition read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5094,34 +5759,34 @@ class ReadBasicVendorName : public ReadAttribute { } }; -class SubscribeAttributeBasicVendorName : public SubscribeAttribute { +class SubscribeAttributeBarrierControlBarrierPosition : public SubscribeAttribute { public: - SubscribeAttributeBasicVendorName() - : SubscribeAttribute("vendor-name") + SubscribeAttributeBarrierControlBarrierPosition() + : SubscribeAttribute("barrier-position") { } - ~SubscribeAttributeBasicVendorName() {} + ~SubscribeAttributeBarrierControlBarrierPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000000A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeVendorNameWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.VendorName response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeBarrierPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5133,30 +5798,30 @@ class SubscribeAttributeBasicVendorName : public SubscribeAttribute { }; /* - * Attribute VendorID + * Attribute GeneratedCommandList */ -class ReadBasicVendorID : public ReadAttribute { +class ReadBarrierControlGeneratedCommandList : public ReadAttribute { public: - ReadBasicVendorID() - : ReadAttribute("vendor-id") + ReadBarrierControlGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadBasicVendorID() {} + ~ReadBarrierControlGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.VendorID response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic VendorID read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5164,34 +5829,35 @@ class ReadBasicVendorID : public ReadAttribute { } }; -class SubscribeAttributeBasicVendorID : public SubscribeAttribute { +class SubscribeAttributeBarrierControlGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeBasicVendorID() - : SubscribeAttribute("vendor-id") + SubscribeAttributeBarrierControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeBasicVendorID() {} + ~SubscribeAttributeBarrierControlGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeVendorIDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.VendorID response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5203,30 +5869,30 @@ class SubscribeAttributeBasicVendorID : public SubscribeAttribute { }; /* - * Attribute ProductName + * Attribute AcceptedCommandList */ -class ReadBasicProductName : public ReadAttribute { +class ReadBarrierControlAcceptedCommandList : public ReadAttribute { public: - ReadBasicProductName() - : ReadAttribute("product-name") + ReadBarrierControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadBasicProductName() {} + ~ReadBarrierControlAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductName response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic ProductName read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5234,34 +5900,35 @@ class ReadBasicProductName : public ReadAttribute { } }; -class SubscribeAttributeBasicProductName : public SubscribeAttribute { +class SubscribeAttributeBarrierControlAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeBasicProductName() - : SubscribeAttribute("product-name") + SubscribeAttributeBarrierControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeBasicProductName() {} + ~SubscribeAttributeBarrierControlAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeProductNameWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductName response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5273,30 +5940,30 @@ class SubscribeAttributeBasicProductName : public SubscribeAttribute { }; /* - * Attribute ProductID + * Attribute AttributeList */ -class ReadBasicProductID : public ReadAttribute { +class ReadBarrierControlAttributeList : public ReadAttribute { public: - ReadBasicProductID() - : ReadAttribute("product-id") + ReadBarrierControlAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadBasicProductID() {} + ~ReadBarrierControlAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductID response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic ProductID read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5304,34 +5971,34 @@ class ReadBasicProductID : public ReadAttribute { } }; -class SubscribeAttributeBasicProductID : public SubscribeAttribute { +class SubscribeAttributeBarrierControlAttributeList : public SubscribeAttribute { public: - SubscribeAttributeBasicProductID() - : SubscribeAttribute("product-id") + SubscribeAttributeBarrierControlAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeBasicProductID() {} + ~SubscribeAttributeBarrierControlAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeProductIDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductID response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5343,30 +6010,30 @@ class SubscribeAttributeBasicProductID : public SubscribeAttribute { }; /* - * Attribute NodeLabel + * Attribute FeatureMap */ -class ReadBasicNodeLabel : public ReadAttribute { +class ReadBarrierControlFeatureMap : public ReadAttribute { public: - ReadBasicNodeLabel() - : ReadAttribute("node-label") + ReadBarrierControlFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadBasicNodeLabel() {} + ~ReadBarrierControlFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.NodeLabel response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic NodeLabel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5374,75 +6041,34 @@ class ReadBasicNodeLabel : public ReadAttribute { } }; -class WriteBasicNodeLabel : public WriteAttribute { -public: - WriteBasicNodeLabel() - : WriteAttribute("node-label") - { - AddArgument("attr-name", "node-label"); - AddArgument("attr-value", &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteBasicNodeLabel() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000005) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; - - [cluster writeAttributeNodeLabelWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Basic NodeLabel write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - chip::ByteSpan mValue; -}; - -class SubscribeAttributeBasicNodeLabel : public SubscribeAttribute { +class SubscribeAttributeBarrierControlFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeBasicNodeLabel() - : SubscribeAttribute("node-label") + SubscribeAttributeBarrierControlFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeBasicNodeLabel() {} + ~SubscribeAttributeBarrierControlFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNodeLabelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.NodeLabel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5454,30 +6080,30 @@ class SubscribeAttributeBasicNodeLabel : public SubscribeAttribute { }; /* - * Attribute Location + * Attribute ClusterRevision */ -class ReadBasicLocation : public ReadAttribute { +class ReadBarrierControlClusterRevision : public ReadAttribute { public: - ReadBasicLocation() - : ReadAttribute("location") + ReadBarrierControlClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadBasicLocation() {} + ~ReadBarrierControlClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.Location response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic Location read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BarrierControl ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5485,110 +6111,153 @@ class ReadBasicLocation : public ReadAttribute { } }; -class WriteBasicLocation : public WriteAttribute { +class SubscribeAttributeBarrierControlClusterRevision : public SubscribeAttribute { public: - WriteBasicLocation() - : WriteAttribute("location") + SubscribeAttributeBarrierControlClusterRevision() + : SubscribeAttribute("cluster-revision") { - AddArgument("attr-name", "location"); - AddArgument("attr-value", &mValue); - WriteAttribute::AddArguments(); } - ~WriteBasicLocation() {} + ~SubscribeAttributeBarrierControlClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeLocationWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Basic Location write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - chip::ByteSpan mValue; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; -class SubscribeAttributeBasicLocation : public SubscribeAttribute { +/*----------------------------------------------------------------------------*\ +| Cluster Basic | 0x0028 | +|------------------------------------------------------------------------------| +| Commands: | | +| * MfgSpecificPing | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * DataModelRevision | 0x0000 | +| * VendorName | 0x0001 | +| * VendorID | 0x0002 | +| * ProductName | 0x0003 | +| * ProductID | 0x0004 | +| * NodeLabel | 0x0005 | +| * Location | 0x0006 | +| * HardwareVersion | 0x0007 | +| * HardwareVersionString | 0x0008 | +| * SoftwareVersion | 0x0009 | +| * SoftwareVersionString | 0x000A | +| * ManufacturingDate | 0x000B | +| * PartNumber | 0x000C | +| * ProductURL | 0x000D | +| * ProductLabel | 0x000E | +| * SerialNumber | 0x000F | +| * LocalConfigDisabled | 0x0010 | +| * Reachable | 0x0011 | +| * UniqueID | 0x0012 | +| * CapabilityMinima | 0x0013 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * StartUp | 0x0000 | +| * ShutDown | 0x0001 | +| * Leave | 0x0002 | +| * ReachableChanged | 0x0003 | +\*----------------------------------------------------------------------------*/ + +/* + * Command MfgSpecificPing + */ +class BasicMfgSpecificPing : public ClusterCommand { public: - SubscribeAttributeBasicLocation() - : SubscribeAttribute("location") + BasicMfgSpecificPing() + : ClusterCommand("mfg-specific-ping") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~SubscribeAttributeBasicLocation() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) command (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLocationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.Location response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPBasicClusterMfgSpecificPingParams 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 mfgSpecificPingWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::Basic::Commands::MfgSpecificPing::Type mRequest; }; /* - * Attribute HardwareVersion + * Attribute DataModelRevision */ -class ReadBasicHardwareVersion : public ReadAttribute { +class ReadBasicDataModelRevision : public ReadAttribute { public: - ReadBasicHardwareVersion() - : ReadAttribute("hardware-version") + ReadBasicDataModelRevision() + : ReadAttribute("data-model-revision") { } - ~ReadBasicHardwareVersion() {} + ~ReadBasicDataModelRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.HardwareVersion response %@", [value description]); + [cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.DataModelRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic HardwareVersion read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic DataModelRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5596,34 +6265,34 @@ class ReadBasicHardwareVersion : public ReadAttribute { } }; -class SubscribeAttributeBasicHardwareVersion : public SubscribeAttribute { +class SubscribeAttributeBasicDataModelRevision : public SubscribeAttribute { public: - SubscribeAttributeBasicHardwareVersion() - : SubscribeAttribute("hardware-version") + SubscribeAttributeBasicDataModelRevision() + : SubscribeAttribute("data-model-revision") { } - ~SubscribeAttributeBasicHardwareVersion() {} + ~SubscribeAttributeBasicDataModelRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeHardwareVersionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.HardwareVersion response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDataModelRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.DataModelRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5635,30 +6304,30 @@ class SubscribeAttributeBasicHardwareVersion : public SubscribeAttribute { }; /* - * Attribute HardwareVersionString + * Attribute VendorName */ -class ReadBasicHardwareVersionString : public ReadAttribute { +class ReadBasicVendorName : public ReadAttribute { public: - ReadBasicHardwareVersionString() - : ReadAttribute("hardware-version-string") + ReadBasicVendorName() + : ReadAttribute("vendor-name") { } - ~ReadBasicHardwareVersionString() {} + ~ReadBasicVendorName() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.HardwareVersionString response %@", [value description]); + [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.VendorName response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic HardwareVersionString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic VendorName read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5666,35 +6335,34 @@ class ReadBasicHardwareVersionString : public ReadAttribute { } }; -class SubscribeAttributeBasicHardwareVersionString : public SubscribeAttribute { +class SubscribeAttributeBasicVendorName : public SubscribeAttribute { public: - SubscribeAttributeBasicHardwareVersionString() - : SubscribeAttribute("hardware-version-string") + SubscribeAttributeBasicVendorName() + : SubscribeAttribute("vendor-name") { } - ~SubscribeAttributeBasicHardwareVersionString() {} + ~SubscribeAttributeBasicVendorName() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeHardwareVersionStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.HardwareVersionString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeVendorNameWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.VendorName response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5706,30 +6374,30 @@ class SubscribeAttributeBasicHardwareVersionString : public SubscribeAttribute { }; /* - * Attribute SoftwareVersion + * Attribute VendorID */ -class ReadBasicSoftwareVersion : public ReadAttribute { +class ReadBasicVendorID : public ReadAttribute { public: - ReadBasicSoftwareVersion() - : ReadAttribute("software-version") + ReadBasicVendorID() + : ReadAttribute("vendor-id") { } - ~ReadBasicSoftwareVersion() {} + ~ReadBasicVendorID() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.SoftwareVersion response %@", [value description]); + [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.VendorID response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic SoftwareVersion read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic VendorID read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5737,34 +6405,34 @@ class ReadBasicSoftwareVersion : public ReadAttribute { } }; -class SubscribeAttributeBasicSoftwareVersion : public SubscribeAttribute { +class SubscribeAttributeBasicVendorID : public SubscribeAttribute { public: - SubscribeAttributeBasicSoftwareVersion() - : SubscribeAttribute("software-version") + SubscribeAttributeBasicVendorID() + : SubscribeAttribute("vendor-id") { } - ~SubscribeAttributeBasicSoftwareVersion() {} + ~SubscribeAttributeBasicVendorID() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSoftwareVersionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.SoftwareVersion response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeVendorIDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.VendorID response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5776,30 +6444,30 @@ class SubscribeAttributeBasicSoftwareVersion : public SubscribeAttribute { }; /* - * Attribute SoftwareVersionString + * Attribute ProductName */ -class ReadBasicSoftwareVersionString : public ReadAttribute { +class ReadBasicProductName : public ReadAttribute { public: - ReadBasicSoftwareVersionString() - : ReadAttribute("software-version-string") + ReadBasicProductName() + : ReadAttribute("product-name") { } - ~ReadBasicSoftwareVersionString() {} + ~ReadBasicProductName() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.SoftwareVersionString response %@", [value description]); + [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductName response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic SoftwareVersionString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic ProductName read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5807,35 +6475,34 @@ class ReadBasicSoftwareVersionString : public ReadAttribute { } }; -class SubscribeAttributeBasicSoftwareVersionString : public SubscribeAttribute { +class SubscribeAttributeBasicProductName : public SubscribeAttribute { public: - SubscribeAttributeBasicSoftwareVersionString() - : SubscribeAttribute("software-version-string") + SubscribeAttributeBasicProductName() + : SubscribeAttribute("product-name") { } - ~SubscribeAttributeBasicSoftwareVersionString() {} + ~SubscribeAttributeBasicProductName() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeSoftwareVersionStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.SoftwareVersionString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeProductNameWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductName response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5847,30 +6514,30 @@ class SubscribeAttributeBasicSoftwareVersionString : public SubscribeAttribute { }; /* - * Attribute ManufacturingDate + * Attribute ProductID */ -class ReadBasicManufacturingDate : public ReadAttribute { +class ReadBasicProductID : public ReadAttribute { public: - ReadBasicManufacturingDate() - : ReadAttribute("manufacturing-date") + ReadBasicProductID() + : ReadAttribute("product-id") { } - ~ReadBasicManufacturingDate() {} + ~ReadBasicProductID() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ManufacturingDate response %@", [value description]); + [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductID response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic ManufacturingDate read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic ProductID read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5878,34 +6545,34 @@ class ReadBasicManufacturingDate : public ReadAttribute { } }; -class SubscribeAttributeBasicManufacturingDate : public SubscribeAttribute { +class SubscribeAttributeBasicProductID : public SubscribeAttribute { public: - SubscribeAttributeBasicManufacturingDate() - : SubscribeAttribute("manufacturing-date") + SubscribeAttributeBasicProductID() + : SubscribeAttribute("product-id") { } - ~SubscribeAttributeBasicManufacturingDate() {} + ~SubscribeAttributeBasicProductID() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeManufacturingDateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ManufacturingDate response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeProductIDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductID response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5917,30 +6584,30 @@ class SubscribeAttributeBasicManufacturingDate : public SubscribeAttribute { }; /* - * Attribute PartNumber + * Attribute NodeLabel */ -class ReadBasicPartNumber : public ReadAttribute { +class ReadBasicNodeLabel : public ReadAttribute { public: - ReadBasicPartNumber() - : ReadAttribute("part-number") + ReadBasicNodeLabel() + : ReadAttribute("node-label") { } - ~ReadBasicPartNumber() {} + ~ReadBasicNodeLabel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.PartNumber response %@", [value description]); + [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.NodeLabel response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic PartNumber read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic NodeLabel read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -5948,34 +6615,75 @@ class ReadBasicPartNumber : public ReadAttribute { } }; -class SubscribeAttributeBasicPartNumber : public SubscribeAttribute { +class WriteBasicNodeLabel : public WriteAttribute { public: - SubscribeAttributeBasicPartNumber() - : SubscribeAttribute("part-number") + WriteBasicNodeLabel() + : WriteAttribute("node-label") { + AddArgument("attr-name", "node-label"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBasicPartNumber() {} + ~WriteBasicNodeLabel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeNodeLabelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Basic NodeLabel write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBasicNodeLabel : public SubscribeAttribute { +public: + SubscribeAttributeBasicNodeLabel() + : SubscribeAttribute("node-label") + { + } + + ~SubscribeAttributeBasicNodeLabel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePartNumberWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.PartNumber response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNodeLabelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.NodeLabel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -5987,30 +6695,30 @@ class SubscribeAttributeBasicPartNumber : public SubscribeAttribute { }; /* - * Attribute ProductURL + * Attribute Location */ -class ReadBasicProductURL : public ReadAttribute { +class ReadBasicLocation : public ReadAttribute { public: - ReadBasicProductURL() - : ReadAttribute("product-url") + ReadBasicLocation() + : ReadAttribute("location") { } - ~ReadBasicProductURL() {} + ~ReadBasicLocation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductURL response %@", [value description]); + [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.Location response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic ProductURL read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic Location read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6018,34 +6726,75 @@ class ReadBasicProductURL : public ReadAttribute { } }; -class SubscribeAttributeBasicProductURL : public SubscribeAttribute { +class WriteBasicLocation : public WriteAttribute { public: - SubscribeAttributeBasicProductURL() - : SubscribeAttribute("product-url") + WriteBasicLocation() + : WriteAttribute("location") { + AddArgument("attr-name", "location"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBasicProductURL() {} + ~WriteBasicLocation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeLocationWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Basic Location write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBasicLocation : public SubscribeAttribute { +public: + SubscribeAttributeBasicLocation() + : SubscribeAttribute("location") + { + } + + ~SubscribeAttributeBasicLocation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeProductURLWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductURL response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLocationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.Location response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -6057,30 +6806,30 @@ class SubscribeAttributeBasicProductURL : public SubscribeAttribute { }; /* - * Attribute ProductLabel + * Attribute HardwareVersion */ -class ReadBasicProductLabel : public ReadAttribute { +class ReadBasicHardwareVersion : public ReadAttribute { public: - ReadBasicProductLabel() - : ReadAttribute("product-label") + ReadBasicHardwareVersion() + : ReadAttribute("hardware-version") { } - ~ReadBasicProductLabel() {} + ~ReadBasicHardwareVersion() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductLabel response %@", [value description]); + [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.HardwareVersion response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic ProductLabel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic HardwareVersion read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6088,34 +6837,34 @@ class ReadBasicProductLabel : public ReadAttribute { } }; -class SubscribeAttributeBasicProductLabel : public SubscribeAttribute { +class SubscribeAttributeBasicHardwareVersion : public SubscribeAttribute { public: - SubscribeAttributeBasicProductLabel() - : SubscribeAttribute("product-label") + SubscribeAttributeBasicHardwareVersion() + : SubscribeAttribute("hardware-version") { } - ~SubscribeAttributeBasicProductLabel() {} + ~SubscribeAttributeBasicHardwareVersion() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeProductLabelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ProductLabel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeHardwareVersionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.HardwareVersion response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -6127,30 +6876,30 @@ class SubscribeAttributeBasicProductLabel : public SubscribeAttribute { }; /* - * Attribute SerialNumber + * Attribute HardwareVersionString */ -class ReadBasicSerialNumber : public ReadAttribute { +class ReadBasicHardwareVersionString : public ReadAttribute { public: - ReadBasicSerialNumber() - : ReadAttribute("serial-number") + ReadBasicHardwareVersionString() + : ReadAttribute("hardware-version-string") { } - ~ReadBasicSerialNumber() {} + ~ReadBasicHardwareVersionString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.SerialNumber response %@", [value description]); + [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.HardwareVersionString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic SerialNumber read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic HardwareVersionString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6158,34 +6907,35 @@ class ReadBasicSerialNumber : public ReadAttribute { } }; -class SubscribeAttributeBasicSerialNumber : public SubscribeAttribute { +class SubscribeAttributeBasicHardwareVersionString : public SubscribeAttribute { public: - SubscribeAttributeBasicSerialNumber() - : SubscribeAttribute("serial-number") + SubscribeAttributeBasicHardwareVersionString() + : SubscribeAttribute("hardware-version-string") { } - ~SubscribeAttributeBasicSerialNumber() {} + ~SubscribeAttributeBasicHardwareVersionString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSerialNumberWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.SerialNumber response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeHardwareVersionStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.HardwareVersionString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -6197,30 +6947,30 @@ class SubscribeAttributeBasicSerialNumber : public SubscribeAttribute { }; /* - * Attribute LocalConfigDisabled + * Attribute SoftwareVersion */ -class ReadBasicLocalConfigDisabled : public ReadAttribute { +class ReadBasicSoftwareVersion : public ReadAttribute { public: - ReadBasicLocalConfigDisabled() - : ReadAttribute("local-config-disabled") + ReadBasicSoftwareVersion() + : ReadAttribute("software-version") { } - ~ReadBasicLocalConfigDisabled() {} + ~ReadBasicSoftwareVersion() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.LocalConfigDisabled response %@", [value description]); + [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.SoftwareVersion response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic LocalConfigDisabled read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic SoftwareVersion read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6228,45 +6978,536 @@ class ReadBasicLocalConfigDisabled : public ReadAttribute { } }; -class WriteBasicLocalConfigDisabled : public WriteAttribute { +class SubscribeAttributeBasicSoftwareVersion : public SubscribeAttribute { public: - WriteBasicLocalConfigDisabled() - : WriteAttribute("local-config-disabled") + SubscribeAttributeBasicSoftwareVersion() + : SubscribeAttribute("software-version") { - AddArgument("attr-name", "local-config-disabled"); - AddArgument("attr-value", 0, 1, &mValue); - WriteAttribute::AddArguments(); } - ~WriteBasicLocalConfigDisabled() {} + ~SubscribeAttributeBasicSoftwareVersion() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSoftwareVersionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.SoftwareVersion response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeLocalConfigDisabledWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Basic LocalConfigDisabled write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - bool mValue; -}; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute SoftwareVersionString + */ +class ReadBasicSoftwareVersionString : public ReadAttribute { +public: + ReadBasicSoftwareVersionString() + : ReadAttribute("software-version-string") + { + } + + ~ReadBasicSoftwareVersionString() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.SoftwareVersionString response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic SoftwareVersionString read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicSoftwareVersionString : public SubscribeAttribute { +public: + SubscribeAttributeBasicSoftwareVersionString() + : SubscribeAttribute("software-version-string") + { + } + + ~SubscribeAttributeBasicSoftwareVersionString() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeSoftwareVersionStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.SoftwareVersionString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ManufacturingDate + */ +class ReadBasicManufacturingDate : public ReadAttribute { +public: + ReadBasicManufacturingDate() + : ReadAttribute("manufacturing-date") + { + } + + ~ReadBasicManufacturingDate() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ManufacturingDate response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic ManufacturingDate read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicManufacturingDate : public SubscribeAttribute { +public: + SubscribeAttributeBasicManufacturingDate() + : SubscribeAttribute("manufacturing-date") + { + } + + ~SubscribeAttributeBasicManufacturingDate() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeManufacturingDateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ManufacturingDate response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute PartNumber + */ +class ReadBasicPartNumber : public ReadAttribute { +public: + ReadBasicPartNumber() + : ReadAttribute("part-number") + { + } + + ~ReadBasicPartNumber() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.PartNumber response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic PartNumber read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicPartNumber : public SubscribeAttribute { +public: + SubscribeAttributeBasicPartNumber() + : SubscribeAttribute("part-number") + { + } + + ~SubscribeAttributeBasicPartNumber() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePartNumberWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.PartNumber response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ProductURL + */ +class ReadBasicProductURL : public ReadAttribute { +public: + ReadBasicProductURL() + : ReadAttribute("product-url") + { + } + + ~ReadBasicProductURL() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000D) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductURL response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic ProductURL read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicProductURL : public SubscribeAttribute { +public: + SubscribeAttributeBasicProductURL() + : SubscribeAttribute("product-url") + { + } + + ~SubscribeAttributeBasicProductURL() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeProductURLWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductURL response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ProductLabel + */ +class ReadBasicProductLabel : public ReadAttribute { +public: + ReadBasicProductLabel() + : ReadAttribute("product-label") + { + } + + ~ReadBasicProductLabel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000E) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductLabel response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic ProductLabel read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicProductLabel : public SubscribeAttribute { +public: + SubscribeAttributeBasicProductLabel() + : SubscribeAttribute("product-label") + { + } + + ~SubscribeAttributeBasicProductLabel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeProductLabelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ProductLabel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute SerialNumber + */ +class ReadBasicSerialNumber : public ReadAttribute { +public: + ReadBasicSerialNumber() + : ReadAttribute("serial-number") + { + } + + ~ReadBasicSerialNumber() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.SerialNumber response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic SerialNumber read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicSerialNumber : public SubscribeAttribute { +public: + SubscribeAttributeBasicSerialNumber() + : SubscribeAttribute("serial-number") + { + } + + ~SubscribeAttributeBasicSerialNumber() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSerialNumberWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.SerialNumber response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute LocalConfigDisabled + */ +class ReadBasicLocalConfigDisabled : public ReadAttribute { +public: + ReadBasicLocalConfigDisabled() + : ReadAttribute("local-config-disabled") + { + } + + ~ReadBasicLocalConfigDisabled() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.LocalConfigDisabled response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic LocalConfigDisabled read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteBasicLocalConfigDisabled : public WriteAttribute { +public: + WriteBasicLocalConfigDisabled() + : WriteAttribute("local-config-disabled") + { + AddArgument("attr-name", "local-config-disabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBasicLocalConfigDisabled() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeLocalConfigDisabledWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Basic LocalConfigDisabled write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; class SubscribeAttributeBasicLocalConfigDisabled : public SubscribeAttribute { public: @@ -6729,30 +7970,30 @@ class SubscribeAttributeBasicAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute FeatureMap */ -class ReadBasicClusterRevision : public ReadAttribute { +class ReadBasicFeatureMap : public ReadAttribute { public: - ReadBasicClusterRevision() - : ReadAttribute("cluster-revision") + ReadBasicFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadBasicClusterRevision() {} + ~ReadBasicFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Basic.ClusterRevision response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Basic ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Basic FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6760,9 +8001,79 @@ class ReadBasicClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeBasicClusterRevision : public SubscribeAttribute { +class SubscribeAttributeBasicFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeBasicClusterRevision() + SubscribeAttributeBasicFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBasicFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadBasicClusterRevision : public ReadAttribute { +public: + ReadBasicClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadBasicClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Basic.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Basic ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBasicClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeBasicClusterRevision() : SubscribeAttribute("cluster-revision") { } @@ -6823,32 +8134,32 @@ class SubscribeAttributeBasicClusterRevision : public SubscribeAttribute { \*----------------------------------------------------------------------------*/ /* - * Attribute OutOfService + * Attribute ActiveText */ -class ReadBinaryInputBasicOutOfService : public ReadAttribute { +class ReadBinaryInputBasicActiveText : public ReadAttribute { public: - ReadBinaryInputBasicOutOfService() - : ReadAttribute("out-of-service") + ReadBinaryInputBasicActiveText() + : ReadAttribute("active-text") { } - ~ReadBinaryInputBasicOutOfService() {} + ~ReadBinaryInputBasicActiveText() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000051) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); + [cluster readAttributeActiveTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.ActiveText response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic OutOfService read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic ActiveText read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6856,21 +8167,21 @@ class ReadBinaryInputBasicOutOfService : public ReadAttribute { } }; -class WriteBinaryInputBasicOutOfService : public WriteAttribute { +class WriteBinaryInputBasicActiveText : public WriteAttribute { public: - WriteBinaryInputBasicOutOfService() - : WriteAttribute("out-of-service") + WriteBinaryInputBasicActiveText() + : WriteAttribute("active-text") { - AddArgument("attr-name", "out-of-service"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "active-text"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteBinaryInputBasicOutOfService() {} + ~WriteBinaryInputBasicActiveText() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000051) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -6879,37 +8190,39 @@ class WriteBinaryInputBasicOutOfService : public WriteAttribute { CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; - [cluster writeAttributeOutOfServiceWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic OutOfService write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeActiveTextWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "BinaryInputBasic ActiveText write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeBinaryInputBasicOutOfService : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicActiveText : public SubscribeAttribute { public: - SubscribeAttributeBinaryInputBasicOutOfService() - : SubscribeAttribute("out-of-service") + SubscribeAttributeBinaryInputBasicActiveText() + : SubscribeAttribute("active-text") { } - ~SubscribeAttributeBinaryInputBasicOutOfService() {} + ~SubscribeAttributeBinaryInputBasicActiveText() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000051) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -6918,16 +8231,16 @@ class SubscribeAttributeBinaryInputBasicOutOfService : public SubscribeAttribute params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOutOfServiceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActiveTextWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.ActiveText response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -6939,32 +8252,32 @@ class SubscribeAttributeBinaryInputBasicOutOfService : public SubscribeAttribute }; /* - * Attribute PresentValue + * Attribute Description */ -class ReadBinaryInputBasicPresentValue : public ReadAttribute { +class ReadBinaryInputBasicDescription : public ReadAttribute { public: - ReadBinaryInputBasicPresentValue() - : ReadAttribute("present-value") + ReadBinaryInputBasicDescription() + : ReadAttribute("description") { } - ~ReadBinaryInputBasicPresentValue() {} + ~ReadBinaryInputBasicDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000055) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.Description response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic PresentValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic Description read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -6972,21 +8285,21 @@ class ReadBinaryInputBasicPresentValue : public ReadAttribute { } }; -class WriteBinaryInputBasicPresentValue : public WriteAttribute { +class WriteBinaryInputBasicDescription : public WriteAttribute { public: - WriteBinaryInputBasicPresentValue() - : WriteAttribute("present-value") + WriteBinaryInputBasicDescription() + : WriteAttribute("description") { - AddArgument("attr-name", "present-value"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "description"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteBinaryInputBasicPresentValue() {} + ~WriteBinaryInputBasicDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000055) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -6995,37 +8308,39 @@ class WriteBinaryInputBasicPresentValue : public WriteAttribute { CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; - [cluster writeAttributePresentValueWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic PresentValue write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeDescriptionWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "BinaryInputBasic Description write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeBinaryInputBasicPresentValue : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicDescription : public SubscribeAttribute { public: - SubscribeAttributeBinaryInputBasicPresentValue() - : SubscribeAttribute("present-value") + SubscribeAttributeBinaryInputBasicDescription() + : SubscribeAttribute("description") { } - ~SubscribeAttributeBinaryInputBasicPresentValue() {} + ~SubscribeAttributeBinaryInputBasicDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000055) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -7034,16 +8349,16 @@ class SubscribeAttributeBinaryInputBasicPresentValue : public SubscribeAttribute params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePresentValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.Description response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7055,32 +8370,32 @@ class SubscribeAttributeBinaryInputBasicPresentValue : public SubscribeAttribute }; /* - * Attribute StatusFlags + * Attribute InactiveText */ -class ReadBinaryInputBasicStatusFlags : public ReadAttribute { +class ReadBinaryInputBasicInactiveText : public ReadAttribute { public: - ReadBinaryInputBasicStatusFlags() - : ReadAttribute("status-flags") + ReadBinaryInputBasicInactiveText() + : ReadAttribute("inactive-text") { } - ~ReadBinaryInputBasicStatusFlags() {} + ~ReadBinaryInputBasicInactiveText() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000006F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000002E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); + [cluster readAttributeInactiveTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.InactiveText response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic StatusFlags read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic InactiveText read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7088,18 +8403,62 @@ class ReadBinaryInputBasicStatusFlags : public ReadAttribute { } }; -class SubscribeAttributeBinaryInputBasicStatusFlags : public SubscribeAttribute { +class WriteBinaryInputBasicInactiveText : public WriteAttribute { public: - SubscribeAttributeBinaryInputBasicStatusFlags() - : SubscribeAttribute("status-flags") + WriteBinaryInputBasicInactiveText() + : WriteAttribute("inactive-text") { + AddArgument("attr-name", "inactive-text"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBinaryInputBasicStatusFlags() {} + ~WriteBinaryInputBasicInactiveText() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000006F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x0000002E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeInactiveTextWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BinaryInputBasic InactiveText write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBinaryInputBasicInactiveText : public SubscribeAttribute { +public: + SubscribeAttributeBinaryInputBasicInactiveText() + : SubscribeAttribute("inactive-text") + { + } + + ~SubscribeAttributeBinaryInputBasicInactiveText() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000002E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -7108,16 +8467,16 @@ class SubscribeAttributeBinaryInputBasicStatusFlags : public SubscribeAttribute params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStatusFlagsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeInactiveTextWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.InactiveText response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7129,32 +8488,32 @@ class SubscribeAttributeBinaryInputBasicStatusFlags : public SubscribeAttribute }; /* - * Attribute GeneratedCommandList + * Attribute OutOfService */ -class ReadBinaryInputBasicGeneratedCommandList : public ReadAttribute { +class ReadBinaryInputBasicOutOfService : public ReadAttribute { public: - ReadBinaryInputBasicGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadBinaryInputBasicOutOfService() + : ReadAttribute("out-of-service") { } - ~ReadBinaryInputBasicGeneratedCommandList() {} + ~ReadBinaryInputBasicOutOfService() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000051) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", [value description]); + [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic OutOfService read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7162,18 +8521,60 @@ class ReadBinaryInputBasicGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBinaryInputBasicGeneratedCommandList : public SubscribeAttribute { +class WriteBinaryInputBasicOutOfService : public WriteAttribute { public: - SubscribeAttributeBinaryInputBasicGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteBinaryInputBasicOutOfService() + : WriteAttribute("out-of-service") { + AddArgument("attr-name", "out-of-service"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBinaryInputBasicGeneratedCommandList() {} + ~WriteBinaryInputBasicOutOfService() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000051) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeOutOfServiceWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BinaryInputBasic OutOfService write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeBinaryInputBasicOutOfService : public SubscribeAttribute { +public: + SubscribeAttributeBinaryInputBasicOutOfService() + : SubscribeAttribute("out-of-service") + { + } + + ~SubscribeAttributeBinaryInputBasicOutOfService() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000051) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -7182,17 +8583,16 @@ class SubscribeAttributeBinaryInputBasicGeneratedCommandList : public SubscribeA params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOutOfServiceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7204,32 +8604,32 @@ class SubscribeAttributeBinaryInputBasicGeneratedCommandList : public SubscribeA }; /* - * Attribute AcceptedCommandList + * Attribute Polarity */ -class ReadBinaryInputBasicAcceptedCommandList : public ReadAttribute { +class ReadBinaryInputBasicPolarity : public ReadAttribute { public: - ReadBinaryInputBasicAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadBinaryInputBasicPolarity() + : ReadAttribute("polarity") { } - ~ReadBinaryInputBasicAcceptedCommandList() {} + ~ReadBinaryInputBasicPolarity() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000054) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", [value description]); + [cluster readAttributePolarityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.Polarity response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic Polarity read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7237,18 +8637,18 @@ class ReadBinaryInputBasicAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBinaryInputBasicAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicPolarity : public SubscribeAttribute { public: - SubscribeAttributeBinaryInputBasicAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeBinaryInputBasicPolarity() + : SubscribeAttribute("polarity") { } - ~SubscribeAttributeBinaryInputBasicAcceptedCommandList() {} + ~SubscribeAttributeBinaryInputBasicPolarity() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000054) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -7257,17 +8657,16 @@ class SubscribeAttributeBinaryInputBasicAcceptedCommandList : public SubscribeAt params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePolarityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.Polarity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7279,32 +8678,32 @@ class SubscribeAttributeBinaryInputBasicAcceptedCommandList : public SubscribeAt }; /* - * Attribute AttributeList + * Attribute PresentValue */ -class ReadBinaryInputBasicAttributeList : public ReadAttribute { +class ReadBinaryInputBasicPresentValue : public ReadAttribute { public: - ReadBinaryInputBasicAttributeList() - : ReadAttribute("attribute-list") + ReadBinaryInputBasicPresentValue() + : ReadAttribute("present-value") { } - ~ReadBinaryInputBasicAttributeList() {} + ~ReadBinaryInputBasicPresentValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000055) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); + [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic PresentValue read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7312,18 +8711,60 @@ class ReadBinaryInputBasicAttributeList : public ReadAttribute { } }; -class SubscribeAttributeBinaryInputBasicAttributeList : public SubscribeAttribute { +class WriteBinaryInputBasicPresentValue : public WriteAttribute { public: - SubscribeAttributeBinaryInputBasicAttributeList() - : SubscribeAttribute("attribute-list") + WriteBinaryInputBasicPresentValue() + : WriteAttribute("present-value") { + AddArgument("attr-name", "present-value"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBinaryInputBasicAttributeList() {} + ~WriteBinaryInputBasicPresentValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000055) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributePresentValueWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "BinaryInputBasic PresentValue write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeBinaryInputBasicPresentValue : public SubscribeAttribute { +public: + SubscribeAttributeBinaryInputBasicPresentValue() + : SubscribeAttribute("present-value") + { + } + + ~SubscribeAttributeBinaryInputBasicPresentValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000055) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId @@ -7332,16 +8773,16 @@ class SubscribeAttributeBinaryInputBasicAttributeList : public SubscribeAttribut params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePresentValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7353,32 +8794,32 @@ class SubscribeAttributeBinaryInputBasicAttributeList : public SubscribeAttribut }; /* - * Attribute ClusterRevision + * Attribute Reliability */ -class ReadBinaryInputBasicClusterRevision : public ReadAttribute { +class ReadBinaryInputBasicReliability : public ReadAttribute { public: - ReadBinaryInputBasicClusterRevision() - : ReadAttribute("cluster-revision") + ReadBinaryInputBasicReliability() + : ReadAttribute("reliability") { } - ~ReadBinaryInputBasicClusterRevision() {} + ~ReadBinaryInputBasicReliability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000067) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); + [cluster readAttributeReliabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.Reliability response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BinaryInputBasic ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic Reliability read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7386,196 +8827,152 @@ class ReadBinaryInputBasicClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeBinaryInputBasicClusterRevision : public SubscribeAttribute { +class WriteBinaryInputBasicReliability : public WriteAttribute { public: - SubscribeAttributeBinaryInputBasicClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteBinaryInputBasicReliability() + : WriteAttribute("reliability") { + AddArgument("attr-name", "reliability"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeBinaryInputBasicClusterRevision() {} + ~WriteBinaryInputBasicReliability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000067) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + [cluster writeAttributeReliabilityWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "BinaryInputBasic Reliability write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } -}; -/*----------------------------------------------------------------------------*\ -| Cluster Binding | 0x001E | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Binding | 0x0000 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ +private: + uint8_t mValue; +}; -/* - * Attribute Binding - */ -class ReadBindingBinding : public ReadAttribute { +class SubscribeAttributeBinaryInputBasicReliability : public SubscribeAttribute { public: - ReadBindingBinding() - : ReadAttribute("binding") + SubscribeAttributeBinaryInputBasicReliability() + : SubscribeAttribute("reliability") { } - ~ReadBindingBinding() {} + ~SubscribeAttributeBinaryInputBasicReliability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000067) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster readAttributeBindingWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.Binding response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster subscribeAttributeReliabilityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.Reliability response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - if (error != nil) { - ChipLogError(chipTool, "Binding Binding read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } }; -class WriteBindingBinding : public WriteAttribute { +/* + * Attribute StatusFlags + */ +class ReadBinaryInputBasicStatusFlags : public ReadAttribute { public: - WriteBindingBinding() - : WriteAttribute("binding") - , mComplex(&mValue) + ReadBinaryInputBasicStatusFlags() + : ReadAttribute("status-flags") { - AddArgument("attr-name", "binding"); - AddArgument("attr-value", &mComplex); - WriteAttribute::AddArguments(); } - ~WriteBindingBinding() {} + ~ReadBinaryInputBasicStatusFlags() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) WriteAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000006F) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - CHIPBindingClusterTargetStruct * newElement_0; - newElement_0 = [CHIPBindingClusterTargetStruct new]; - if (entry_0.node.HasValue()) { - newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; - } else { - newElement_0.node = nil; - } - if (entry_0.group.HasValue()) { - newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; - } else { - newElement_0.group = nil; - } - if (entry_0.endpoint.HasValue()) { - newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; - } else { - newElement_0.endpoint = nil; - } - if (entry_0.cluster.HasValue()) { - newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; - } else { - newElement_0.cluster = nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - [cluster writeAttributeBindingWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Binding Binding write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + if (error != nil) { + ChipLogError(chipTool, "BinaryInputBasic StatusFlags read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; }; -class SubscribeAttributeBindingBinding : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicStatusFlags : public SubscribeAttribute { public: - SubscribeAttributeBindingBinding() - : SubscribeAttribute("binding") + SubscribeAttributeBinaryInputBasicStatusFlags() + : SubscribeAttribute("status-flags") { } - ~SubscribeAttributeBindingBinding() {} + ~SubscribeAttributeBinaryInputBasicStatusFlags() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000006F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBindingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.Binding response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeStatusFlagsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7587,30 +8984,32 @@ class SubscribeAttributeBindingBinding : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute ApplicationType */ -class ReadBindingGeneratedCommandList : public ReadAttribute { +class ReadBinaryInputBasicApplicationType : public ReadAttribute { public: - ReadBindingGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadBinaryInputBasicApplicationType() + : ReadAttribute("application-type") { } - ~ReadBindingGeneratedCommandList() {} + ~ReadBinaryInputBasicApplicationType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000100) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.GeneratedCommandList response %@", [value description]); + [cluster readAttributeApplicationTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.ApplicationType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Binding GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic ApplicationType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7618,31 +9017,32 @@ class ReadBindingGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBindingGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicApplicationType : public SubscribeAttribute { public: - SubscribeAttributeBindingGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeBinaryInputBasicApplicationType() + : SubscribeAttribute("application-type") { } - ~SubscribeAttributeBindingGeneratedCommandList() {} + ~SubscribeAttributeBinaryInputBasicApplicationType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000100) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeApplicationTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.GeneratedCommandList response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.ApplicationType response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -7658,30 +9058,32 @@ class SubscribeAttributeBindingGeneratedCommandList : public SubscribeAttribute }; /* - * Attribute AcceptedCommandList + * Attribute GeneratedCommandList */ -class ReadBindingAcceptedCommandList : public ReadAttribute { +class ReadBinaryInputBasicGeneratedCommandList : public ReadAttribute { public: - ReadBindingAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadBinaryInputBasicGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadBindingAcceptedCommandList() {} + ~ReadBinaryInputBasicGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.AcceptedCommandList response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Binding AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7689,34 +9091,37 @@ class ReadBindingAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBindingAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeBindingAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeBinaryInputBasicGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeBindingAcceptedCommandList() {} + ~SubscribeAttributeBinaryInputBasicGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7728,30 +9133,32 @@ class SubscribeAttributeBindingAcceptedCommandList : public SubscribeAttribute { }; /* - * Attribute AttributeList + * Attribute AcceptedCommandList */ -class ReadBindingAttributeList : public ReadAttribute { +class ReadBinaryInputBasicAcceptedCommandList : public ReadAttribute { public: - ReadBindingAttributeList() - : ReadAttribute("attribute-list") + ReadBinaryInputBasicAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadBindingAttributeList() {} + ~ReadBinaryInputBasicAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.AttributeList response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Binding AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7759,34 +9166,37 @@ class ReadBindingAttributeList : public ReadAttribute { } }; -class SubscribeAttributeBindingAttributeList : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeBindingAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeBinaryInputBasicAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeBindingAttributeList() {} + ~SubscribeAttributeBinaryInputBasicAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7798,30 +9208,32 @@ class SubscribeAttributeBindingAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute AttributeList */ -class ReadBindingClusterRevision : public ReadAttribute { +class ReadBinaryInputBasicAttributeList : public ReadAttribute { public: - ReadBindingClusterRevision() - : ReadAttribute("cluster-revision") + ReadBinaryInputBasicAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadBindingClusterRevision() {} + ~ReadBinaryInputBasicAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.ClusterRevision response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Binding ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7829,34 +9241,36 @@ class ReadBindingClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeBindingClusterRevision : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicAttributeList : public SubscribeAttribute { public: - SubscribeAttributeBindingClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeBinaryInputBasicAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeBindingClusterRevision() {} + ~SubscribeAttributeBinaryInputBasicAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Binding.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -7867,48 +9281,33 @@ class SubscribeAttributeBindingClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster BooleanState | 0x0045 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * StateValue | 0x0000 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StateChange | 0x0000 | -\*----------------------------------------------------------------------------*/ - /* - * Attribute StateValue + * Attribute FeatureMap */ -class ReadBooleanStateStateValue : public ReadAttribute { +class ReadBinaryInputBasicFeatureMap : public ReadAttribute { public: - ReadBooleanStateStateValue() - : ReadAttribute("state-value") + ReadBinaryInputBasicFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadBooleanStateStateValue() {} + ~ReadBinaryInputBasicFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.StateValue response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BooleanState StateValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7916,30 +9315,32 @@ class ReadBooleanStateStateValue : public ReadAttribute { } }; -class SubscribeAttributeBooleanStateStateValue : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeBooleanStateStateValue() - : SubscribeAttribute("state-value") + SubscribeAttributeBinaryInputBasicFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeBooleanStateStateValue() {} + ~SubscribeAttributeBinaryInputBasicFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStateValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.StateValue response %@", [value description]); + NSLog(@"BinaryInputBasic.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -7955,30 +9356,32 @@ class SubscribeAttributeBooleanStateStateValue : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute ClusterRevision */ -class ReadBooleanStateGeneratedCommandList : public ReadAttribute { +class ReadBinaryInputBasicClusterRevision : public ReadAttribute { public: - ReadBooleanStateGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadBinaryInputBasicClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadBooleanStateGeneratedCommandList() {} + ~ReadBinaryInputBasicClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.GeneratedCommandList response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BooleanState GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "BinaryInputBasic ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -7986,35 +9389,36 @@ class ReadBooleanStateGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBooleanStateGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeBinaryInputBasicClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeBooleanStateGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeBinaryInputBasicClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeBooleanStateGeneratedCommandList() {} + ~SubscribeAttributeBinaryInputBasicClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -8025,31 +9429,262 @@ class SubscribeAttributeBooleanStateGeneratedCommandList : public SubscribeAttri } }; +/*----------------------------------------------------------------------------*\ +| Cluster Binding | 0x001E | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Binding | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute AcceptedCommandList + * Attribute Binding */ -class ReadBooleanStateAcceptedCommandList : public ReadAttribute { +class ReadBindingBinding : public ReadAttribute { public: - ReadBooleanStateAcceptedCommandList() + ReadBindingBinding() + : ReadAttribute("binding") + { + } + + ~ReadBindingBinding() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster readAttributeBindingWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.Binding response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Binding Binding read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteBindingBinding : public WriteAttribute { +public: + WriteBindingBinding() + : WriteAttribute("binding") + , mComplex(&mValue) + { + AddArgument("attr-name", "binding"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteBindingBinding() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) WriteAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPBindingClusterTargetStruct * newElement_0; + newElement_0 = [CHIPBindingClusterTargetStruct new]; + if (entry_0.node.HasValue()) { + newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; + } else { + newElement_0.node = nil; + } + if (entry_0.group.HasValue()) { + newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; + } else { + newElement_0.group = nil; + } + if (entry_0.endpoint.HasValue()) { + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; + } else { + newElement_0.endpoint = nil; + } + if (entry_0.cluster.HasValue()) { + newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; + } else { + newElement_0.cluster = nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeBindingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Binding Binding write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeBindingBinding : public SubscribeAttribute { +public: + SubscribeAttributeBindingBinding() + : SubscribeAttribute("binding") + { + } + + ~SubscribeAttributeBindingBinding() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBindingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.Binding response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadBindingGeneratedCommandList : public ReadAttribute { +public: + ReadBindingGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadBindingGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Binding GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBindingGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBindingGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeBindingGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadBindingAcceptedCommandList : public ReadAttribute { +public: + ReadBindingAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadBooleanStateAcceptedCommandList() {} + ~ReadBindingAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); + NSLog(@"Binding.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BooleanState AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Binding AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -8057,35 +9692,34 @@ class ReadBooleanStateAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeBooleanStateAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeBindingAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeBooleanStateAcceptedCommandList() + SubscribeAttributeBindingAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeBooleanStateAcceptedCommandList() {} + ~SubscribeAttributeBindingAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -8099,28 +9733,28 @@ class SubscribeAttributeBooleanStateAcceptedCommandList : public SubscribeAttrib /* * Attribute AttributeList */ -class ReadBooleanStateAttributeList : public ReadAttribute { +class ReadBindingAttributeList : public ReadAttribute { public: - ReadBooleanStateAttributeList() + ReadBindingAttributeList() : ReadAttribute("attribute-list") { } - ~ReadBooleanStateAttributeList() {} + ~ReadBindingAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.AttributeList response %@", [value description]); + NSLog(@"Binding.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BooleanState AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Binding AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -8128,20 +9762,20 @@ class ReadBooleanStateAttributeList : public ReadAttribute { } }; -class SubscribeAttributeBooleanStateAttributeList : public SubscribeAttribute { +class SubscribeAttributeBindingAttributeList : public SubscribeAttribute { public: - SubscribeAttributeBooleanStateAttributeList() + SubscribeAttributeBindingAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeBooleanStateAttributeList() {} + ~SubscribeAttributeBindingAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -8151,7 +9785,7 @@ class SubscribeAttributeBooleanStateAttributeList : public SubscribeAttribute { params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.AttributeList response %@", [value description]); + NSLog(@"Binding.AttributeList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -8166,31 +9800,101 @@ class SubscribeAttributeBooleanStateAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadBindingFeatureMap : public ReadAttribute { +public: + ReadBindingFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadBindingFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Binding FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBindingFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeBindingFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBindingFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Binding.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ -class ReadBooleanStateClusterRevision : public ReadAttribute { +class ReadBindingClusterRevision : public ReadAttribute { public: - ReadBooleanStateClusterRevision() + ReadBindingClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadBooleanStateClusterRevision() {} + ~ReadBindingClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.ClusterRevision response %@", [value description]); + NSLog(@"Binding.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "BooleanState ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Binding ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -8198,20 +9902,20 @@ class ReadBooleanStateClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute { +class SubscribeAttributeBindingClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeBooleanStateClusterRevision() + SubscribeAttributeBindingClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeBooleanStateClusterRevision() {} + ~SubscribeAttributeBindingClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -8221,7 +9925,7 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"BooleanState.ClusterRevision response %@", [value description]); + NSLog(@"Binding.ClusterRevision response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -8237,26 +9941,12 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute }; /*----------------------------------------------------------------------------*\ -| Cluster BridgedActions | 0x0025 | +| Cluster BooleanState | 0x0045 | |------------------------------------------------------------------------------| | Commands: | | -| * InstantAction | 0x00 | -| * InstantActionWithTransition | 0x01 | -| * StartAction | 0x02 | -| * StartActionWithDuration | 0x03 | -| * StopAction | 0x04 | -| * PauseAction | 0x05 | -| * PauseActionWithDuration | 0x06 | -| * ResumeAction | 0x07 | -| * EnableAction | 0x08 | -| * EnableActionWithDuration | 0x09 | -| * DisableAction | 0x0A | -| * DisableActionWithDuration | 0x0B | |------------------------------------------------------------------------------| | Attributes: | | -| * ActionList | 0x0000 | -| * EndpointList | 0x0001 | -| * SetupUrl | 0x0002 | +| * StateValue | 0x0000 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -8264,220 +9954,463 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | -| * StateChanged | 0x0000 | -| * ActionFailed | 0x0001 | +| * StateChange | 0x0000 | \*----------------------------------------------------------------------------*/ /* - * Command DisableAction + * Attribute StateValue */ -class BridgedActionsDisableAction : public ClusterCommand { +class ReadBooleanStateStateValue : public ReadAttribute { public: - BridgedActionsDisableAction() - : ClusterCommand("disable-action") + ReadBooleanStateStateValue() + : ReadAttribute("state-value") { - AddArgument("ActionID", 0, UINT16_MAX, &mActionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); - ClusterCommand::AddArguments(); } + ~ReadBooleanStateStateValue() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterDisableActionParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - if (mInvokeID.HasValue()) { - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster disableActionWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.StateValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BooleanState StateValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } +}; -private: - uint16_t mActionID; - chip::Optional mInvokeID; +class SubscribeAttributeBooleanStateStateValue : public SubscribeAttribute { +public: + SubscribeAttributeBooleanStateStateValue() + : SubscribeAttribute("state-value") + { + } + + ~SubscribeAttributeBooleanStateStateValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeStateValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.StateValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command DisableActionWithDuration + * Attribute GeneratedCommandList */ -class BridgedActionsDisableActionWithDuration : public ClusterCommand { +class ReadBooleanStateGeneratedCommandList : public ReadAttribute { public: - BridgedActionsDisableActionWithDuration() - : ClusterCommand("disable-action-with-duration") + ReadBooleanStateGeneratedCommandList() + : ReadAttribute("generated-command-list") { - AddArgument("ActionID", 0, UINT16_MAX, &mActionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); - AddArgument("Duration", 0, UINT32_MAX, &mDuration); - ClusterCommand::AddArguments(); } + ~ReadBooleanStateGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterDisableActionWithDurationParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - if (mInvokeID.HasValue()) { - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; - } - params.duration = [NSNumber numberWithUnsignedInt:mDuration]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster disableActionWithDurationWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BooleanState GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } +}; -private: - uint16_t mActionID; - chip::Optional mInvokeID; - uint32_t mDuration; +class SubscribeAttributeBooleanStateGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBooleanStateGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeBooleanStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command EnableAction + * Attribute AcceptedCommandList */ -class BridgedActionsEnableAction : public ClusterCommand { +class ReadBooleanStateAcceptedCommandList : public ReadAttribute { public: - BridgedActionsEnableAction() - : ClusterCommand("enable-action") + ReadBooleanStateAcceptedCommandList() + : ReadAttribute("accepted-command-list") { - AddArgument("ActionID", 0, UINT16_MAX, &mActionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); - ClusterCommand::AddArguments(); } + ~ReadBooleanStateAcceptedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterEnableActionParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - if (mInvokeID.HasValue()) { - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster enableActionWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BooleanState AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } +}; -private: - uint16_t mActionID; - chip::Optional mInvokeID; +class SubscribeAttributeBooleanStateAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBooleanStateAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeBooleanStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command EnableActionWithDuration + * Attribute AttributeList */ -class BridgedActionsEnableActionWithDuration : public ClusterCommand { +class ReadBooleanStateAttributeList : public ReadAttribute { public: - BridgedActionsEnableActionWithDuration() - : ClusterCommand("enable-action-with-duration") + ReadBooleanStateAttributeList() + : ReadAttribute("attribute-list") { - AddArgument("ActionID", 0, UINT16_MAX, &mActionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); - AddArgument("Duration", 0, UINT32_MAX, &mDuration); - ClusterCommand::AddArguments(); } + ~ReadBooleanStateAttributeList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterEnableActionWithDurationParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - if (mInvokeID.HasValue()) { - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; - } - params.duration = [NSNumber numberWithUnsignedInt:mDuration]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster enableActionWithDurationWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BooleanState AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } +}; -private: - uint16_t mActionID; - chip::Optional mInvokeID; - uint32_t mDuration; +class SubscribeAttributeBooleanStateAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeBooleanStateAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeBooleanStateAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadBooleanStateFeatureMap : public ReadAttribute { +public: + ReadBooleanStateFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadBooleanStateFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BooleanState FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBooleanStateFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeBooleanStateFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBooleanStateFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadBooleanStateClusterRevision : public ReadAttribute { +public: + ReadBooleanStateClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadBooleanStateClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BooleanState ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeBooleanStateClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeBooleanStateClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BooleanState.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; +/*----------------------------------------------------------------------------*\ +| Cluster BridgedActions | 0x0025 | +|------------------------------------------------------------------------------| +| Commands: | | +| * InstantAction | 0x00 | +| * InstantActionWithTransition | 0x01 | +| * StartAction | 0x02 | +| * StartActionWithDuration | 0x03 | +| * StopAction | 0x04 | +| * PauseAction | 0x05 | +| * PauseActionWithDuration | 0x06 | +| * ResumeAction | 0x07 | +| * EnableAction | 0x08 | +| * EnableActionWithDuration | 0x09 | +| * DisableAction | 0x0A | +| * DisableActionWithDuration | 0x0B | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ActionList | 0x0000 | +| * EndpointList | 0x0001 | +| * SetupUrl | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * StateChanged | 0x0000 | +| * ActionFailed | 0x0001 | +\*----------------------------------------------------------------------------*/ + /* * Command InstantAction */ @@ -8486,6 +10419,7 @@ class BridgedActionsInstantAction : public ClusterCommand { BridgedActionsInstantAction() : ClusterCommand("instant-action") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); ClusterCommand::AddArguments(); @@ -8525,6 +10459,7 @@ class BridgedActionsInstantAction : public ClusterCommand { } private: + chip::app::Clusters::BridgedActions::Commands::InstantAction::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; }; @@ -8537,6 +10472,7 @@ class BridgedActionsInstantActionWithTransition : public ClusterCommand { BridgedActionsInstantActionWithTransition() : ClusterCommand("instant-action-with-transition") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); @@ -8578,19 +10514,21 @@ class BridgedActionsInstantActionWithTransition : public ClusterCommand { } private: + chip::app::Clusters::BridgedActions::Commands::InstantActionWithTransition::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; uint16_t mTransitionTime; }; /* - * Command PauseAction + * Command StartAction */ -class BridgedActionsPauseAction : public ClusterCommand { +class BridgedActionsStartAction : public ClusterCommand { public: - BridgedActionsPauseAction() - : ClusterCommand("pause-action") + BridgedActionsStartAction() + : ClusterCommand("start-action") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); ClusterCommand::AddArguments(); @@ -8598,12 +10536,12 @@ class BridgedActionsPauseAction : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterPauseActionParams alloc] init]; + __auto_type * params = [[CHIPBridgedActionsClusterStartActionParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; @@ -8613,7 +10551,7 @@ class BridgedActionsPauseAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster pauseActionWithParams:params + [cluster startActionWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -8630,18 +10568,20 @@ class BridgedActionsPauseAction : public ClusterCommand { } private: + chip::app::Clusters::BridgedActions::Commands::StartAction::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; }; /* - * Command PauseActionWithDuration + * Command StartActionWithDuration */ -class BridgedActionsPauseActionWithDuration : public ClusterCommand { +class BridgedActionsStartActionWithDuration : public ClusterCommand { public: - BridgedActionsPauseActionWithDuration() - : ClusterCommand("pause-action-with-duration") + BridgedActionsStartActionWithDuration() + : ClusterCommand("start-action-with-duration") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); AddArgument("Duration", 0, UINT32_MAX, &mDuration); @@ -8650,12 +10590,12 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterPauseActionWithDurationParams alloc] init]; + __auto_type * params = [[CHIPBridgedActionsClusterStartActionWithDurationParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; @@ -8666,7 +10606,7 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster pauseActionWithDurationWithParams:params + [cluster startActionWithDurationWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -8683,19 +10623,21 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { } private: + chip::app::Clusters::BridgedActions::Commands::StartActionWithDuration::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; uint32_t mDuration; }; /* - * Command ResumeAction + * Command StopAction */ -class BridgedActionsResumeAction : public ClusterCommand { +class BridgedActionsStopAction : public ClusterCommand { public: - BridgedActionsResumeAction() - : ClusterCommand("resume-action") + BridgedActionsStopAction() + : ClusterCommand("stop-action") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); ClusterCommand::AddArguments(); @@ -8703,12 +10645,12 @@ class BridgedActionsResumeAction : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterResumeActionParams alloc] init]; + __auto_type * params = [[CHIPBridgedActionsClusterStopActionParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; @@ -8718,35 +10660,37 @@ class BridgedActionsResumeAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resumeActionWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster stopActionWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: + chip::app::Clusters::BridgedActions::Commands::StopAction::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; }; /* - * Command StartAction + * Command PauseAction */ -class BridgedActionsStartAction : public ClusterCommand { +class BridgedActionsPauseAction : public ClusterCommand { public: - BridgedActionsStartAction() - : ClusterCommand("start-action") + BridgedActionsPauseAction() + : ClusterCommand("pause-action") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); ClusterCommand::AddArguments(); @@ -8754,12 +10698,12 @@ class BridgedActionsStartAction : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterStartActionParams alloc] init]; + __auto_type * params = [[CHIPBridgedActionsClusterPauseActionParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; @@ -8769,7 +10713,7 @@ class BridgedActionsStartAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster startActionWithParams:params + [cluster pauseActionWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -8786,18 +10730,20 @@ class BridgedActionsStartAction : public ClusterCommand { } private: + chip::app::Clusters::BridgedActions::Commands::PauseAction::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; }; /* - * Command StartActionWithDuration + * Command PauseActionWithDuration */ -class BridgedActionsStartActionWithDuration : public ClusterCommand { +class BridgedActionsPauseActionWithDuration : public ClusterCommand { public: - BridgedActionsStartActionWithDuration() - : ClusterCommand("start-action-with-duration") + BridgedActionsPauseActionWithDuration() + : ClusterCommand("pause-action-with-duration") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); AddArgument("Duration", 0, UINT32_MAX, &mDuration); @@ -8806,12 +10752,12 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterStartActionWithDurationParams alloc] init]; + __auto_type * params = [[CHIPBridgedActionsClusterPauseActionWithDurationParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; @@ -8822,7 +10768,7 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster startActionWithDurationWithParams:params + [cluster pauseActionWithDurationWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -8839,19 +10785,21 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { } private: + chip::app::Clusters::BridgedActions::Commands::PauseActionWithDuration::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; uint32_t mDuration; }; /* - * Command StopAction + * Command ResumeAction */ -class BridgedActionsStopAction : public ClusterCommand { +class BridgedActionsResumeAction : public ClusterCommand { public: - BridgedActionsStopAction() - : ClusterCommand("stop-action") + BridgedActionsResumeAction() + : ClusterCommand("resume-action") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ActionID", 0, UINT16_MAX, &mActionID); AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); ClusterCommand::AddArguments(); @@ -8859,12 +10807,12 @@ class BridgedActionsStopAction : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPBridgedActionsClusterStopActionParams alloc] init]; + __auto_type * params = [[CHIPBridgedActionsClusterResumeActionParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; @@ -8874,27 +10822,246 @@ class BridgedActionsStopAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopActionWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster resumeActionWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::BridgedActions::Commands::ResumeAction::Type mRequest; + uint16_t mActionID; + chip::Optional mInvokeID; +}; + +/* + * Command EnableAction + */ +class BridgedActionsEnableAction : public ClusterCommand { +public: + BridgedActionsEnableAction() + : ClusterCommand("enable-action") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ActionID", 0, UINT16_MAX, &mActionID); + AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPBridgedActionsClusterEnableActionParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enableActionWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::BridgedActions::Commands::EnableAction::Type mRequest; + uint16_t mActionID; + chip::Optional mInvokeID; +}; + +/* + * Command EnableActionWithDuration + */ +class BridgedActionsEnableActionWithDuration : public ClusterCommand { +public: + BridgedActionsEnableActionWithDuration() + : ClusterCommand("enable-action-with-duration") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ActionID", 0, UINT16_MAX, &mActionID); + AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); + AddArgument("Duration", 0, UINT32_MAX, &mDuration); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPBridgedActionsClusterEnableActionWithDurationParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } + params.duration = [NSNumber numberWithUnsignedInt:mDuration]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enableActionWithDurationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::BridgedActions::Commands::EnableActionWithDuration::Type mRequest; + uint16_t mActionID; + chip::Optional mInvokeID; + uint32_t mDuration; +}; + +/* + * Command DisableAction + */ +class BridgedActionsDisableAction : public ClusterCommand { +public: + BridgedActionsDisableAction() + : ClusterCommand("disable-action") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ActionID", 0, UINT16_MAX, &mActionID); + AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPBridgedActionsClusterDisableActionParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster disableActionWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: + chip::app::Clusters::BridgedActions::Commands::DisableAction::Type mRequest; uint16_t mActionID; chip::Optional mInvokeID; }; +/* + * Command DisableActionWithDuration + */ +class BridgedActionsDisableActionWithDuration : public ClusterCommand { +public: + BridgedActionsDisableActionWithDuration() + : ClusterCommand("disable-action-with-duration") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ActionID", 0, UINT16_MAX, &mActionID); + AddArgument("InvokeID", 0, UINT32_MAX, &mInvokeID); + AddArgument("Duration", 0, UINT32_MAX, &mDuration); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPBridgedActionsClusterDisableActionWithDurationParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } + params.duration = [NSNumber numberWithUnsignedInt:mDuration]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster disableActionWithDurationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::BridgedActions::Commands::DisableActionWithDuration::Type mRequest; + uint16_t mActionID; + chip::Optional mInvokeID; + uint32_t mDuration; +}; + /* * Attribute ActionList */ @@ -9317,6 +11484,76 @@ class SubscribeAttributeBridgedActionsAttributeList : public SubscribeAttribute } }; +/* + * Attribute FeatureMap + */ +class ReadBridgedActionsFeatureMap : public ReadAttribute { +public: + ReadBridgedActionsFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadBridgedActionsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BridgedActions.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BridgedActions FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBridgedActionsFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeBridgedActionsFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBridgedActionsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BridgedActions.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -10804,6 +13041,80 @@ class SubscribeAttributeBridgedDeviceBasicAttributeList : public SubscribeAttrib } }; +/* + * Attribute FeatureMap + */ +class ReadBridgedDeviceBasicFeatureMap : public ReadAttribute { +public: + ReadBridgedDeviceBasicFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadBridgedDeviceBasicFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000039) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BridgedDeviceBasic.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "BridgedDeviceBasic FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeBridgedDeviceBasicFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeBridgedDeviceBasicFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBridgedDeviceBasicFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000039) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BridgedDeviceBasic.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -10908,6 +13219,7 @@ class ChannelChangeChannel : public ClusterCommand { ChannelChangeChannel() : ClusterCommand("change-channel") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Match", &mMatch); ClusterCommand::AddArguments(); } @@ -10945,6 +13257,7 @@ class ChannelChangeChannel : public ClusterCommand { } private: + chip::app::Clusters::Channel::Commands::ChangeChannel::Type mRequest; chip::ByteSpan mMatch; }; @@ -10956,6 +13269,7 @@ class ChannelChangeChannelByNumber : public ClusterCommand { ChannelChangeChannelByNumber() : ClusterCommand("change-channel-by-number") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("MajorNumber", 0, UINT16_MAX, &mMajorNumber); AddArgument("MinorNumber", 0, UINT16_MAX, &mMinorNumber); ClusterCommand::AddArguments(); @@ -10993,6 +13307,7 @@ class ChannelChangeChannelByNumber : public ClusterCommand { } private: + chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Type mRequest; uint16_t mMajorNumber; uint16_t mMinorNumber; }; @@ -11005,6 +13320,7 @@ class ChannelSkipChannel : public ClusterCommand { ChannelSkipChannel() : ClusterCommand("skip-channel") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Count", 0, UINT16_MAX, &mCount); ClusterCommand::AddArguments(); } @@ -11040,6 +13356,7 @@ class ChannelSkipChannel : public ClusterCommand { } private: + chip::app::Clusters::Channel::Commands::SkipChannel::Type mRequest; uint16_t mCount; }; @@ -11468,6 +13785,76 @@ class SubscribeAttributeChannelAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadChannelFeatureMap : public ReadAttribute { +public: + ReadChannelFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadChannelFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Channel.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Channel FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeChannelFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeChannelFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeChannelFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Channel.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -11625,133 +14012,15 @@ class SubscribeAttributeChannelClusterRevision : public SubscribeAttribute { \*----------------------------------------------------------------------------*/ /* - * Command ColorLoopSet - */ -class ColorControlColorLoopSet : public ClusterCommand { -public: - ColorControlColorLoopSet() - : ClusterCommand("color-loop-set") - { - AddArgument("UpdateFlags", 0, UINT8_MAX, &mUpdateFlags); - AddArgument("Action", 0, UINT8_MAX, &mAction); - AddArgument("Direction", 0, UINT8_MAX, &mDirection); - AddArgument("Time", 0, UINT16_MAX, &mTime); - AddArgument("StartHue", 0, UINT16_MAX, &mStartHue); - AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000044) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.updateFlags = [NSNumber numberWithUnsignedChar:mUpdateFlags]; - params.action = [NSNumber numberWithUnsignedChar:mAction]; - params.direction = [NSNumber numberWithUnsignedChar:mDirection]; - params.time = [NSNumber numberWithUnsignedShort:mTime]; - params.startHue = [NSNumber numberWithUnsignedShort:mStartHue]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mUpdateFlags; - uint8_t mAction; - uint8_t mDirection; - uint16_t mTime; - uint16_t mStartHue; - uint8_t mOptionsMask; - uint8_t mOptionsOverride; -}; - -/* - * Command EnhancedMoveHue - */ -class ColorControlEnhancedMoveHue : public ClusterCommand { -public: - ColorControlEnhancedMoveHue() - : ClusterCommand("enhanced-move-hue") - { - AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); - AddArgument("Rate", 0, UINT16_MAX, &mRate); - AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000041) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; - params.rate = [NSNumber numberWithUnsignedShort:mRate]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mMoveMode; - uint16_t mRate; - uint8_t mOptionsMask; - uint8_t mOptionsOverride; -}; - -/* - * Command EnhancedMoveToHue + * Command MoveToHue */ -class ColorControlEnhancedMoveToHue : public ClusterCommand { +class ColorControlMoveToHue : public ClusterCommand { public: - ColorControlEnhancedMoveToHue() - : ClusterCommand("enhanced-move-to-hue") + ColorControlMoveToHue() + : ClusterCommand("move-to-hue") { - AddArgument("EnhancedHue", 0, UINT16_MAX, &mEnhancedHue); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Hue", 0, UINT8_MAX, &mHue); AddArgument("Direction", 0, UINT8_MAX, &mDirection); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); @@ -11761,15 +14030,15 @@ class ColorControlEnhancedMoveToHue : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000040) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.enhancedHue = [NSNumber numberWithUnsignedShort:mEnhancedHue]; + params.hue = [NSNumber numberWithUnsignedChar:mHue]; params.direction = [NSNumber numberWithUnsignedChar:mDirection]; params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; @@ -11777,179 +14046,7 @@ class ColorControlEnhancedMoveToHue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint16_t mEnhancedHue; - uint8_t mDirection; - uint16_t mTransitionTime; - uint8_t mOptionsMask; - uint8_t mOptionsOverride; -}; - -/* - * Command EnhancedMoveToHueAndSaturation - */ -class ColorControlEnhancedMoveToHueAndSaturation : public ClusterCommand { -public: - ColorControlEnhancedMoveToHueAndSaturation() - : ClusterCommand("enhanced-move-to-hue-and-saturation") - { - AddArgument("EnhancedHue", 0, UINT16_MAX, &mEnhancedHue); - AddArgument("Saturation", 0, UINT8_MAX, &mSaturation); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000043) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.enhancedHue = [NSNumber numberWithUnsignedShort:mEnhancedHue]; - params.saturation = [NSNumber numberWithUnsignedChar:mSaturation]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster enhancedMoveToHueAndSaturationWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint16_t mEnhancedHue; - uint8_t mSaturation; - uint16_t mTransitionTime; - uint8_t mOptionsMask; - uint8_t mOptionsOverride; -}; - -/* - * Command EnhancedStepHue - */ -class ColorControlEnhancedStepHue : public ClusterCommand { -public: - ColorControlEnhancedStepHue() - : ClusterCommand("enhanced-step-hue") - { - AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); - AddArgument("StepSize", 0, UINT16_MAX, &mStepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000042) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; - params.stepSize = [NSNumber numberWithUnsignedShort:mStepSize]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster enhancedStepHueWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mStepMode; - uint16_t mStepSize; - uint16_t mTransitionTime; - uint8_t mOptionsMask; - uint8_t mOptionsOverride; -}; - -/* - * Command MoveColor - */ -class ColorControlMoveColor : public ClusterCommand { -public: - ColorControlMoveColor() - : ClusterCommand("move-color") - { - AddArgument("RateX", INT16_MIN, INT16_MAX, &mRateX); - AddArgument("RateY", INT16_MIN, INT16_MAX, &mRateY); - AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000008) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.rateX = [NSNumber numberWithShort:mRateX]; - params.rateY = [NSNumber numberWithShort:mRateY]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster moveColorWithParams:params + [cluster moveToHueWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -11966,69 +14063,10 @@ class ColorControlMoveColor : public ClusterCommand { } private: - int16_t mRateX; - int16_t mRateY; - uint8_t mOptionsMask; - uint8_t mOptionsOverride; -}; - -/* - * Command MoveColorTemperature - */ -class ColorControlMoveColorTemperature : public ClusterCommand { -public: - ColorControlMoveColorTemperature() - : ClusterCommand("move-color-temperature") - { - AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); - AddArgument("Rate", 0, UINT16_MAX, &mRate); - AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum); - AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum); - AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000004B) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; - params.rate = [NSNumber numberWithUnsignedShort:mRate]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:mColorTemperatureMinimum]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:mColorTemperatureMaximum]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mMoveMode; - uint16_t mRate; - uint16_t mColorTemperatureMinimum; - uint16_t mColorTemperatureMaximum; + chip::app::Clusters::ColorControl::Commands::MoveToHue::Type mRequest; + uint8_t mHue; + uint8_t mDirection; + uint16_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; @@ -12041,6 +14079,7 @@ class ColorControlMoveHue : public ClusterCommand { ColorControlMoveHue() : ClusterCommand("move-hue") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); AddArgument("Rate", 0, UINT8_MAX, &mRate); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); @@ -12082,6 +14121,7 @@ class ColorControlMoveHue : public ClusterCommand { } private: + chip::app::Clusters::ColorControl::Commands::MoveHue::Type mRequest; uint8_t mMoveMode; uint8_t mRate; uint8_t mOptionsMask; @@ -12089,15 +14129,17 @@ class ColorControlMoveHue : public ClusterCommand { }; /* - * Command MoveSaturation + * Command StepHue */ -class ColorControlMoveSaturation : public ClusterCommand { +class ColorControlStepHue : public ClusterCommand { public: - ColorControlMoveSaturation() - : ClusterCommand("move-saturation") + ColorControlStepHue() + : ClusterCommand("step-hue") { - AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); - AddArgument("Rate", 0, UINT8_MAX, &mRate); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); + AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); + AddArgument("TransitionTime", 0, UINT8_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12105,54 +14147,57 @@ class ColorControlMoveSaturation : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; - params.rate = [NSNumber numberWithUnsignedChar:mRate]; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedChar:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster stepHueWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mMoveMode; - uint8_t mRate; + chip::app::Clusters::ColorControl::Commands::StepHue::Type mRequest; + uint8_t mStepMode; + uint8_t mStepSize; + uint8_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Command MoveToColor + * Command MoveToSaturation */ -class ColorControlMoveToColor : public ClusterCommand { +class ColorControlMoveToSaturation : public ClusterCommand { public: - ColorControlMoveToColor() - : ClusterCommand("move-to-color") + ColorControlMoveToSaturation() + : ClusterCommand("move-to-saturation") { - AddArgument("ColorX", 0, UINT16_MAX, &mColorX); - AddArgument("ColorY", 0, UINT16_MAX, &mColorY); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Saturation", 0, UINT8_MAX, &mSaturation); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); @@ -12161,56 +14206,56 @@ class ColorControlMoveToColor : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.colorX = [NSNumber numberWithUnsignedShort:mColorX]; - params.colorY = [NSNumber numberWithUnsignedShort:mColorY]; + params.saturation = [NSNumber numberWithUnsignedChar:mSaturation]; params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToColorWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster moveToSaturationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mColorX; - uint16_t mColorY; + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type mRequest; + uint8_t mSaturation; uint16_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Command MoveToColorTemperature + * Command MoveSaturation */ -class ColorControlMoveToColorTemperature : public ClusterCommand { +class ColorControlMoveSaturation : public ClusterCommand { public: - ColorControlMoveToColorTemperature() - : ClusterCommand("move-to-color-temperature") + ColorControlMoveSaturation() + : ClusterCommand("move-saturation") { - AddArgument("ColorTemperature", 0, UINT16_MAX, &mColorTemperature); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); + AddArgument("Rate", 0, UINT8_MAX, &mRate); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12218,55 +14263,57 @@ class ColorControlMoveToColorTemperature : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.colorTemperature = [NSNumber numberWithUnsignedShort:mColorTemperature]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mColorTemperature; - uint16_t mTransitionTime; + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type mRequest; + uint8_t mMoveMode; + uint8_t mRate; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Command MoveToHue + * Command StepSaturation */ -class ColorControlMoveToHue : public ClusterCommand { +class ColorControlStepSaturation : public ClusterCommand { public: - ColorControlMoveToHue() - : ClusterCommand("move-to-hue") + ColorControlStepSaturation() + : ClusterCommand("step-saturation") { - AddArgument("Hue", 0, UINT8_MAX, &mHue); - AddArgument("Direction", 0, UINT8_MAX, &mDirection); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); + AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); + AddArgument("TransitionTime", 0, UINT8_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12274,42 +14321,43 @@ class ColorControlMoveToHue : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.hue = [NSNumber numberWithUnsignedChar:mHue]; - params.direction = [NSNumber numberWithUnsignedChar:mDirection]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedChar:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster stepSaturationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mHue; - uint8_t mDirection; - uint16_t mTransitionTime; + chip::app::Clusters::ColorControl::Commands::StepSaturation::Type mRequest; + uint8_t mStepMode; + uint8_t mStepSize; + uint8_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; @@ -12322,6 +14370,7 @@ class ColorControlMoveToHueAndSaturation : public ClusterCommand { ColorControlMoveToHueAndSaturation() : ClusterCommand("move-to-hue-and-saturation") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Hue", 0, UINT8_MAX, &mHue); AddArgument("Saturation", 0, UINT8_MAX, &mSaturation); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); @@ -12365,6 +14414,7 @@ class ColorControlMoveToHueAndSaturation : public ClusterCommand { } private: + chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type mRequest; uint8_t mHue; uint8_t mSaturation; uint16_t mTransitionTime; @@ -12373,14 +14423,16 @@ class ColorControlMoveToHueAndSaturation : public ClusterCommand { }; /* - * Command MoveToSaturation + * Command MoveToColor */ -class ColorControlMoveToSaturation : public ClusterCommand { +class ColorControlMoveToColor : public ClusterCommand { public: - ColorControlMoveToSaturation() - : ClusterCommand("move-to-saturation") + ColorControlMoveToColor() + : ClusterCommand("move-to-color") { - AddArgument("Saturation", 0, UINT8_MAX, &mSaturation); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ColorX", 0, UINT16_MAX, &mColorX); + AddArgument("ColorY", 0, UINT16_MAX, &mColorY); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); @@ -12389,44 +14441,104 @@ class ColorControlMoveToSaturation : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.saturation = [NSNumber numberWithUnsignedChar:mSaturation]; + params.colorX = [NSNumber numberWithUnsignedShort:mColorX]; + params.colorY = [NSNumber numberWithUnsignedShort:mColorY]; params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToSaturationWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster moveToColorWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mSaturation; + chip::app::Clusters::ColorControl::Commands::MoveToColor::Type mRequest; + uint16_t mColorX; + uint16_t mColorY; uint16_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; +/* + * Command MoveColor + */ +class ColorControlMoveColor : public ClusterCommand { +public: + ColorControlMoveColor() + : ClusterCommand("move-color") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("RateX", INT16_MIN, INT16_MAX, &mRateX); + AddArgument("RateY", INT16_MIN, INT16_MAX, &mRateY); + AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); + AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.rateX = [NSNumber numberWithShort:mRateX]; + params.rateY = [NSNumber numberWithShort:mRateY]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster moveColorWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ColorControl::Commands::MoveColor::Type mRequest; + int16_t mRateX; + int16_t mRateY; + uint8_t mOptionsMask; + uint8_t mOptionsOverride; +}; + /* * Command StepColor */ @@ -12435,6 +14547,7 @@ class ColorControlStepColor : public ClusterCommand { ColorControlStepColor() : ClusterCommand("step-color") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("StepX", INT16_MIN, INT16_MAX, &mStepX); AddArgument("StepY", INT16_MIN, INT16_MAX, &mStepY); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); @@ -12478,6 +14591,7 @@ class ColorControlStepColor : public ClusterCommand { } private: + chip::app::Clusters::ColorControl::Commands::StepColor::Type mRequest; int16_t mStepX; int16_t mStepY; uint16_t mTransitionTime; @@ -12486,18 +14600,16 @@ class ColorControlStepColor : public ClusterCommand { }; /* - * Command StepColorTemperature + * Command MoveToColorTemperature */ -class ColorControlStepColorTemperature : public ClusterCommand { +class ColorControlMoveToColorTemperature : public ClusterCommand { public: - ColorControlStepColorTemperature() - : ClusterCommand("step-color-temperature") + ColorControlMoveToColorTemperature() + : ClusterCommand("move-to-color-temperature") { - AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); - AddArgument("StepSize", 0, UINT16_MAX, &mStepSize); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ColorTemperature", 0, UINT16_MAX, &mColorTemperature); AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum); - AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12505,61 +14617,57 @@ class ColorControlStepColorTemperature : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000004C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000000A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; - params.stepSize = [NSNumber numberWithUnsignedShort:mStepSize]; + params.colorTemperature = [NSNumber numberWithUnsignedShort:mColorTemperature]; params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:mColorTemperatureMinimum]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:mColorTemperatureMaximum]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster moveToColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mStepMode; - uint16_t mStepSize; + chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type mRequest; + uint16_t mColorTemperature; uint16_t mTransitionTime; - uint16_t mColorTemperatureMinimum; - uint16_t mColorTemperatureMaximum; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Command StepHue + * Command EnhancedMoveToHue */ -class ColorControlStepHue : public ClusterCommand { +class ColorControlEnhancedMoveToHue : public ClusterCommand { public: - ColorControlStepHue() - : ClusterCommand("step-hue") + ColorControlEnhancedMoveToHue() + : ClusterCommand("enhanced-move-to-hue") { - AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); - AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); - AddArgument("TransitionTime", 0, UINT8_MAX, &mTransitionTime); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("EnhancedHue", 0, UINT16_MAX, &mEnhancedHue); + AddArgument("Direction", 0, UINT8_MAX, &mDirection); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12567,57 +14675,58 @@ class ColorControlStepHue : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; - params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; - params.transitionTime = [NSNumber numberWithUnsignedChar:mTransitionTime]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:mEnhancedHue]; + params.direction = [NSNumber numberWithUnsignedChar:mDirection]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepHueWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mStepMode; - uint8_t mStepSize; - uint8_t mTransitionTime; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type mRequest; + uint16_t mEnhancedHue; + uint8_t mDirection; + uint16_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Command StepSaturation + * Command EnhancedMoveHue */ -class ColorControlStepSaturation : public ClusterCommand { +class ColorControlEnhancedMoveHue : public ClusterCommand { public: - ColorControlStepSaturation() - : ClusterCommand("step-saturation") + ColorControlEnhancedMoveHue() + : ClusterCommand("enhanced-move-hue") { - AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); - AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); - AddArgument("TransitionTime", 0, UINT8_MAX, &mTransitionTime); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); + AddArgument("Rate", 0, UINT16_MAX, &mRate); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12625,54 +14734,57 @@ class ColorControlStepSaturation : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; - params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; - params.transitionTime = [NSNumber numberWithUnsignedChar:mTransitionTime]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedShort:mRate]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepSaturationWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster enhancedMoveHueWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mStepMode; - uint8_t mStepSize; - uint8_t mTransitionTime; + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type mRequest; + uint8_t mMoveMode; + uint16_t mRate; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Command StopMoveStep + * Command EnhancedStepHue */ -class ColorControlStopMoveStep : public ClusterCommand { +class ColorControlEnhancedStepHue : public ClusterCommand { public: - ColorControlStopMoveStep() - : ClusterCommand("stop-move-step") + ColorControlEnhancedStepHue() + : ClusterCommand("enhanced-step-hue") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); + AddArgument("StepSize", 0, UINT16_MAX, &mStepSize); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); ClusterCommand::AddArguments(); @@ -12680,53 +14792,366 @@ class ColorControlStopMoveStep : public ClusterCommand { CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000047) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedShort:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopMoveStepWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster enhancedStepHueWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: + chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type mRequest; + uint8_t mStepMode; + uint16_t mStepSize; + uint16_t mTransitionTime; uint8_t mOptionsMask; uint8_t mOptionsOverride; }; /* - * Attribute CurrentHue + * Command EnhancedMoveToHueAndSaturation */ -class ReadColorControlCurrentHue : public ReadAttribute { +class ColorControlEnhancedMoveToHueAndSaturation : public ClusterCommand { public: - ReadColorControlCurrentHue() - : ReadAttribute("current-hue") + ColorControlEnhancedMoveToHueAndSaturation() + : ClusterCommand("enhanced-move-to-hue-and-saturation") { - } - - ~ReadColorControlCurrentHue() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + (void) mRequest; // Might not be used if we have no complex args + AddArgument("EnhancedHue", 0, UINT16_MAX, &mEnhancedHue); + AddArgument("Saturation", 0, UINT8_MAX, &mSaturation); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); + AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000043) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.enhancedHue = [NSNumber numberWithUnsignedShort:mEnhancedHue]; + params.saturation = [NSNumber numberWithUnsignedChar:mSaturation]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enhancedMoveToHueAndSaturationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type mRequest; + uint16_t mEnhancedHue; + uint8_t mSaturation; + uint16_t mTransitionTime; + uint8_t mOptionsMask; + uint8_t mOptionsOverride; +}; + +/* + * Command ColorLoopSet + */ +class ColorControlColorLoopSet : public ClusterCommand { +public: + ColorControlColorLoopSet() + : ClusterCommand("color-loop-set") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UpdateFlags", 0, UINT8_MAX, &mUpdateFlags); + AddArgument("Action", 0, UINT8_MAX, &mAction); + AddArgument("Direction", 0, UINT8_MAX, &mDirection); + AddArgument("Time", 0, UINT16_MAX, &mTime); + AddArgument("StartHue", 0, UINT16_MAX, &mStartHue); + AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); + AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000044) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.updateFlags = [NSNumber numberWithUnsignedChar:mUpdateFlags]; + params.action = [NSNumber numberWithUnsignedChar:mAction]; + params.direction = [NSNumber numberWithUnsignedChar:mDirection]; + params.time = [NSNumber numberWithUnsignedShort:mTime]; + params.startHue = [NSNumber numberWithUnsignedShort:mStartHue]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster colorLoopSetWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type mRequest; + uint8_t mUpdateFlags; + uint8_t mAction; + uint8_t mDirection; + uint16_t mTime; + uint16_t mStartHue; + uint8_t mOptionsMask; + uint8_t mOptionsOverride; +}; + +/* + * Command StopMoveStep + */ +class ColorControlStopMoveStep : public ClusterCommand { +public: + ColorControlStopMoveStep() + : ClusterCommand("stop-move-step") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); + AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000047) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type mRequest; + uint8_t mOptionsMask; + uint8_t mOptionsOverride; +}; + +/* + * Command MoveColorTemperature + */ +class ColorControlMoveColorTemperature : public ClusterCommand { +public: + ColorControlMoveColorTemperature() + : ClusterCommand("move-color-temperature") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); + AddArgument("Rate", 0, UINT16_MAX, &mRate); + AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum); + AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum); + AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); + AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000004B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedShort:mRate]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:mColorTemperatureMinimum]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:mColorTemperatureMaximum]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type mRequest; + uint8_t mMoveMode; + uint16_t mRate; + uint16_t mColorTemperatureMinimum; + uint16_t mColorTemperatureMaximum; + uint8_t mOptionsMask; + uint8_t mOptionsOverride; +}; + +/* + * Command StepColorTemperature + */ +class ColorControlStepColorTemperature : public ClusterCommand { +public: + ColorControlStepColorTemperature() + : ClusterCommand("step-color-temperature") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); + AddArgument("StepSize", 0, UINT16_MAX, &mStepSize); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum); + AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum); + AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask); + AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000004C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedShort:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:mColorTemperatureMinimum]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:mColorTemperatureMaximum]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stepColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type mRequest; + uint8_t mStepMode; + uint16_t mStepSize; + uint16_t mTransitionTime; + uint16_t mColorTemperatureMinimum; + uint16_t mColorTemperatureMaximum; + uint8_t mOptionsMask; + uint8_t mOptionsOverride; +}; + +/* + * Attribute CurrentHue + */ +class ReadColorControlCurrentHue : public ReadAttribute { +public: + ReadColorControlCurrentHue() + : ReadAttribute("current-hue") + { + } + + ~ReadColorControlCurrentHue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000000) on endpoint %u", endpointId); @@ -17110,6 +19535,76 @@ class SubscribeAttributeColorControlAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadColorControlFeatureMap : public ReadAttribute { +public: + ReadColorControlFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadColorControlFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ColorControl.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ColorControl FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeColorControlFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeColorControlFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeColorControlFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ColorControl.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -17208,6 +19703,7 @@ class ContentLauncherLaunchContent : public ClusterCommand { : ClusterCommand("launch-content") , mComplex_Search(&mRequest.search) { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Search", &mComplex_Search); AddArgument("AutoPlay", 0, 1, &mAutoPlay); AddArgument("Data", &mData); @@ -17300,6 +19796,7 @@ class ContentLauncherLaunchURL : public ClusterCommand { : ClusterCommand("launch-url") , mComplex_BrandingInformation(&mRequest.brandingInformation) { + (void) mRequest; // Might not be used if we have no complex args AddArgument("ContentURL", &mContentURL); AddArgument("DisplayString", &mDisplayString); AddArgument("BrandingInformation", &mComplex_BrandingInformation); @@ -17520,9 +20017,9 @@ class ContentLauncherLaunchURL : public ClusterCommand { } private: + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type mRequest; chip::ByteSpan mContentURL; chip::Optional mDisplayString; - chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type mRequest; TypedComplexArgument> mComplex_BrandingInformation; }; @@ -17923,6 +20420,76 @@ class SubscribeAttributeContentLauncherAttributeList : public SubscribeAttribute } }; +/* + * Attribute FeatureMap + */ +class ReadContentLauncherFeatureMap : public ReadAttribute { +public: + ReadContentLauncherFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadContentLauncherFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentLauncher.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ContentLauncher FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeContentLauncherFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeContentLauncherFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeContentLauncherFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ContentLauncher.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -18504,6 +21071,76 @@ class SubscribeAttributeDescriptorAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadDescriptorFeatureMap : public ReadAttribute { +public: + ReadDescriptorFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadDescriptorFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Descriptor.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Descriptor FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeDescriptorFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeDescriptorFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeDescriptorFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Descriptor.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -18598,6 +21235,7 @@ class DiagnosticLogsRetrieveLogsRequest : public ClusterCommand { DiagnosticLogsRetrieveLogsRequest() : ClusterCommand("retrieve-logs-request") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("Intent", 0, UINT8_MAX, &mIntent); AddArgument("RequestedProtocol", 0, UINT8_MAX, &mRequestedProtocol); AddArgument("TransferFileDesignator", &mTransferFileDesignator); @@ -18640,6 +21278,7 @@ class DiagnosticLogsRetrieveLogsRequest : public ClusterCommand { } private: + chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type mRequest; uint8_t mIntent; uint8_t mRequestedProtocol; chip::ByteSpan mTransferFileDesignator; @@ -18857,6 +21496,146 @@ class SubscribeAttributeDiagnosticLogsAttributeList : public SubscribeAttribute } }; +/* + * Attribute FeatureMap + */ +class ReadDiagnosticLogsFeatureMap : public ReadAttribute { +public: + ReadDiagnosticLogsFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadDiagnosticLogsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000032) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DiagnosticLogs.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "DiagnosticLogs FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeDiagnosticLogsFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeDiagnosticLogsFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeDiagnosticLogsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000032) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DiagnosticLogs.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadDiagnosticLogsClusterRevision : public ReadAttribute { +public: + ReadDiagnosticLogsClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadDiagnosticLogsClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000032) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DiagnosticLogs.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "DiagnosticLogs ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeDiagnosticLogsClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeDiagnosticLogsClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeDiagnosticLogsClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000032) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DiagnosticLogs.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /*----------------------------------------------------------------------------*\ | Cluster DoorLock | 0x0101 | |------------------------------------------------------------------------------| @@ -18954,431 +21733,549 @@ class SubscribeAttributeDiagnosticLogsAttributeList : public SubscribeAttribute \*----------------------------------------------------------------------------*/ /* - * Command ClearCredential + * Command LockDoor */ -class DoorLockClearCredential : public ClusterCommand { +class DoorLockLockDoor : public ClusterCommand { public: - DoorLockClearCredential() - : ClusterCommand("clear-credential") - , mComplex_Credential(&mRequest.credential) + DoorLockLockDoor() + : ClusterCommand("lock-door") { - AddArgument("Credential", &mComplex_Credential); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("PinCode", &mPinCode); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - if (mRequest.credential.IsNull()) { - params.credential = nil; - } else { - params.credential = [CHIPDoorLockClusterDlCredential new]; - params.credential.credentialType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.Value().credentialType)]; - params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.Value().credentialIndex]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::app::Clusters::DoorLock::Commands::ClearCredential::Type mRequest; - TypedComplexArgument> - mComplex_Credential; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type mRequest; + chip::Optional mPinCode; }; /* - * Command ClearHolidaySchedule + * Command UnlockDoor */ -class DoorLockClearHolidaySchedule : public ClusterCommand { +class DoorLockUnlockDoor : public ClusterCommand { public: - DoorLockClearHolidaySchedule() - : ClusterCommand("clear-holiday-schedule") + DoorLockUnlockDoor() + : ClusterCommand("unlock-door") { - AddArgument("HolidayIndex", 0, UINT8_MAX, &mHolidayIndex); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("PinCode", &mPinCode); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterClearHolidayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.holidayIndex = [NSNumber numberWithUnsignedChar:mHolidayIndex]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mHolidayIndex; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type mRequest; + chip::Optional mPinCode; }; /* - * Command ClearUser + * Command UnlockWithTimeout */ -class DoorLockClearUser : public ClusterCommand { +class DoorLockUnlockWithTimeout : public ClusterCommand { public: - DoorLockClearUser() - : ClusterCommand("clear-user") + DoorLockUnlockWithTimeout() + : ClusterCommand("unlock-with-timeout") { - AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("PinCode", &mPinCode); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterClearUserParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterUnlockWithTimeoutParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.timeout = [NSNumber numberWithUnsignedShort:mTimeout]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearUserWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster unlockWithTimeoutWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mUserIndex; + chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type mRequest; + uint16_t mTimeout; + chip::Optional mPinCode; }; /* - * Command ClearWeekDaySchedule + * Command GetLogRecord */ -class DoorLockClearWeekDaySchedule : public ClusterCommand { +class DoorLockGetLogRecord : public ClusterCommand { public: - DoorLockClearWeekDaySchedule() - : ClusterCommand("clear-week-day-schedule") + DoorLockGetLogRecord() + : ClusterCommand("get-log-record") { - AddArgument("WeekDayIndex", 0, UINT8_MAX, &mWeekDayIndex); - AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("LogIndex", 0, UINT16_MAX, &mLogIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterClearWeekDayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterGetLogRecordParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; - params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.logIndex = [NSNumber numberWithUnsignedShort:mLogIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearWeekDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster getLogRecordWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetLogRecordResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mWeekDayIndex; - uint16_t mUserIndex; + chip::app::Clusters::DoorLock::Commands::GetLogRecord::Type mRequest; + uint16_t mLogIndex; }; /* - * Command ClearYearDaySchedule + * Command SetPINCode */ -class DoorLockClearYearDaySchedule : public ClusterCommand { +class DoorLockSetPINCode : public ClusterCommand { public: - DoorLockClearYearDaySchedule() - : ClusterCommand("clear-year-day-schedule") + DoorLockSetPINCode() + : ClusterCommand("set-pincode") { - AddArgument("YearDayIndex", 0, UINT8_MAX, &mYearDayIndex); - AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); + AddArgument("UserType", 0, UINT8_MAX, &mUserType); + AddArgument("Pin", &mPin); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterClearYearDayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterSetPINCodeParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; - params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; + params.userType = [NSNumber numberWithUnsignedChar:mUserType]; + params.pin = [[NSData alloc] initWithBytes:mPin.data() length:mPin.size()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster setPINCodeWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mYearDayIndex; - uint16_t mUserIndex; + chip::app::Clusters::DoorLock::Commands::SetPINCode::Type mRequest; + uint16_t mUserId; + uint8_t mUserStatus; + uint8_t mUserType; + chip::ByteSpan mPin; }; /* - * Command GetCredentialStatus + * Command GetPINCode */ -class DoorLockGetCredentialStatus : public ClusterCommand { +class DoorLockGetPINCode : public ClusterCommand { public: - DoorLockGetCredentialStatus() - : ClusterCommand("get-credential-status") - , mComplex_Credential(&mRequest.credential) + DoorLockGetPINCode() + : ClusterCommand("get-pincode") { - AddArgument("Credential", &mComplex_Credential); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterGetCredentialStatusParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterGetPINCodeParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.credential = [CHIPDoorLockClusterDlCredential new]; - params.credential.credentialType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.credentialType)]; - params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.credentialIndex]; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getCredentialStatusWithParams:params - completionHandler:^(CHIPDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + getPINCodeWithParams:params + completionHandler:^(CHIPDoorLockClusterGetPINCodeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type mRequest; - TypedComplexArgument mComplex_Credential; + chip::app::Clusters::DoorLock::Commands::GetPINCode::Type mRequest; + uint16_t mUserId; }; /* - * Command GetHolidaySchedule + * Command ClearPINCode */ -class DoorLockGetHolidaySchedule : public ClusterCommand { +class DoorLockClearPINCode : public ClusterCommand { public: - DoorLockGetHolidaySchedule() - : ClusterCommand("get-holiday-schedule") + DoorLockClearPINCode() + : ClusterCommand("clear-pincode") { - AddArgument("HolidayIndex", 0, UINT8_MAX, &mHolidayIndex); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("PinSlotIndex", 0, UINT16_MAX, &mPinSlotIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterGetHolidayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterClearPINCodeParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.holidayIndex = [NSNumber numberWithUnsignedChar:mHolidayIndex]; + params.pinSlotIndex = [NSNumber numberWithUnsignedShort:mPinSlotIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getHolidayScheduleWithParams:params - completionHandler:^(CHIPDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster clearPINCodeWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mHolidayIndex; + chip::app::Clusters::DoorLock::Commands::ClearPINCode::Type mRequest; + uint16_t mPinSlotIndex; }; /* - * Command GetUser + * Command ClearAllPINCodes */ -class DoorLockGetUser : public ClusterCommand { +class DoorLockClearAllPINCodes : public ClusterCommand { public: - DoorLockGetUser() - : ClusterCommand("get-user") + DoorLockClearAllPINCodes() + : ClusterCommand("clear-all-pincodes") { - AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterGetUserParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterClearAllPINCodesParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getUserWithParams:params - completionHandler:^(CHIPDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster clearAllPINCodesWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mUserIndex; + chip::app::Clusters::DoorLock::Commands::ClearAllPINCodes::Type mRequest; }; /* - * Command GetWeekDaySchedule + * Command SetUserStatus */ -class DoorLockGetWeekDaySchedule : public ClusterCommand { +class DoorLockSetUserStatus : public ClusterCommand { public: - DoorLockGetWeekDaySchedule() - : ClusterCommand("get-week-day-schedule") + DoorLockSetUserStatus() + : ClusterCommand("set-user-status") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterSetUserStatusParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setUserStatusWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::DoorLock::Commands::SetUserStatus::Type mRequest; + uint16_t mUserId; + uint8_t mUserStatus; +}; + +/* + * Command GetUserStatus + */ +class DoorLockGetUserStatus : public ClusterCommand { +public: + DoorLockGetUserStatus() + : ClusterCommand("get-user-status") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterGetUserStatusParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getUserStatusWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetUserStatusResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::DoorLock::Commands::GetUserStatus::Type mRequest; + uint16_t mUserId; +}; + +/* + * Command SetWeekDaySchedule + */ +class DoorLockSetWeekDaySchedule : public ClusterCommand { +public: + DoorLockSetWeekDaySchedule() + : ClusterCommand("set-week-day-schedule") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("WeekDayIndex", 0, UINT8_MAX, &mWeekDayIndex); AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + AddArgument("DaysMask", 0, UINT8_MAX, &mDaysMask); + AddArgument("StartHour", 0, UINT8_MAX, &mStartHour); + AddArgument("StartMinute", 0, UINT8_MAX, &mStartMinute); + AddArgument("EndHour", 0, UINT8_MAX, &mEndHour); + AddArgument("EndMinute", 0, UINT8_MAX, &mEndMinute); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterSetWeekDayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.daysMask = [NSNumber numberWithUnsignedChar:mDaysMask]; + params.startHour = [NSNumber numberWithUnsignedChar:mStartHour]; + params.startMinute = [NSNumber numberWithUnsignedChar:mStartMinute]; + params.endHour = [NSNumber numberWithUnsignedChar:mEndHour]; + params.endMinute = [NSNumber numberWithUnsignedChar:mEndMinute]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getWeekDayScheduleWithParams:params - completionHandler:^(CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); + [cluster setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; if (chipError != CHIP_NO_ERROR) { @@ -19394,40 +22291,47 @@ class DoorLockGetWeekDaySchedule : public ClusterCommand { } private: + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type mRequest; uint8_t mWeekDayIndex; uint16_t mUserIndex; + uint8_t mDaysMask; + uint8_t mStartHour; + uint8_t mStartMinute; + uint8_t mEndHour; + uint8_t mEndMinute; }; /* - * Command GetYearDaySchedule + * Command GetWeekDaySchedule */ -class DoorLockGetYearDaySchedule : public ClusterCommand { +class DoorLockGetWeekDaySchedule : public ClusterCommand { public: - DoorLockGetYearDaySchedule() - : ClusterCommand("get-year-day-schedule") + DoorLockGetWeekDaySchedule() + : ClusterCommand("get-week-day-schedule") { - AddArgument("YearDayIndex", 0, UINT8_MAX, &mYearDayIndex); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("WeekDayIndex", 0, UINT8_MAX, &mWeekDayIndex); AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getYearDayScheduleWithParams:params - completionHandler:^(CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, + [cluster getWeekDayScheduleWithParams:params + completionHandler:^(CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); chipError = [CHIPError errorToCHIPErrorCode:error]; @@ -19445,160 +22349,152 @@ class DoorLockGetYearDaySchedule : public ClusterCommand { } private: - uint8_t mYearDayIndex; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type mRequest; + uint8_t mWeekDayIndex; uint16_t mUserIndex; }; /* - * Command LockDoor + * Command ClearWeekDaySchedule */ -class DoorLockLockDoor : public ClusterCommand { +class DoorLockClearWeekDaySchedule : public ClusterCommand { public: - DoorLockLockDoor() - : ClusterCommand("lock-door") + DoorLockClearWeekDaySchedule() + : ClusterCommand("clear-week-day-schedule") { - AddArgument("PinCode", &mPinCode); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("WeekDayIndex", 0, UINT8_MAX, &mWeekDayIndex); + AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterClearWeekDayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - if (mPinCode.HasValue()) { - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; - } + params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::Optional mPinCode; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type mRequest; + uint8_t mWeekDayIndex; + uint16_t mUserIndex; }; /* - * Command SetCredential + * Command SetYearDaySchedule */ -class DoorLockSetCredential : public ClusterCommand { +class DoorLockSetYearDaySchedule : public ClusterCommand { public: - DoorLockSetCredential() - : ClusterCommand("set-credential") - , mComplex_Credential(&mRequest.credential) - { - AddArgument("OperationType", 0, UINT8_MAX, &mOperationType); - AddArgument("Credential", &mComplex_Credential); - AddArgument("CredentialData", &mCredentialData); + DoorLockSetYearDaySchedule() + : ClusterCommand("set-year-day-schedule") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("YearDayIndex", 0, UINT8_MAX, &mYearDayIndex); AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); - AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); - AddArgument("UserType", 0, UINT8_MAX, &mUserType); + AddArgument("LocalStartTime", 0, UINT32_MAX, &mLocalStartTime); + AddArgument("LocalEndTime", 0, UINT32_MAX, &mLocalEndTime); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.operationType = [NSNumber numberWithUnsignedChar:mOperationType]; - params.credential = [CHIPDoorLockClusterDlCredential new]; - params.credential.credentialType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.credentialType)]; - params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.credentialIndex]; - params.credentialData = [[NSData alloc] initWithBytes:mCredentialData.data() length:mCredentialData.size()]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; - params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; - params.userType = [NSNumber numberWithUnsignedChar:mUserType]; + params.localStartTime = [NSNumber numberWithUnsignedInt:mLocalStartTime]; + params.localEndTime = [NSNumber numberWithUnsignedInt:mLocalEndTime]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setCredentialWithParams:params - completionHandler:^( - CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mOperationType; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type mRequest; - TypedComplexArgument mComplex_Credential; - chip::ByteSpan mCredentialData; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type mRequest; + uint8_t mYearDayIndex; uint16_t mUserIndex; - uint8_t mUserStatus; - uint8_t mUserType; + uint32_t mLocalStartTime; + uint32_t mLocalEndTime; }; /* - * Command SetHolidaySchedule + * Command GetYearDaySchedule */ -class DoorLockSetHolidaySchedule : public ClusterCommand { +class DoorLockGetYearDaySchedule : public ClusterCommand { public: - DoorLockSetHolidaySchedule() - : ClusterCommand("set-holiday-schedule") + DoorLockGetYearDaySchedule() + : ClusterCommand("get-year-day-schedule") { - AddArgument("HolidayIndex", 0, UINT8_MAX, &mHolidayIndex); - AddArgument("LocalStartTime", 0, UINT32_MAX, &mLocalStartTime); - AddArgument("LocalEndTime", 0, UINT32_MAX, &mLocalEndTime); - AddArgument("OperatingMode", 0, UINT8_MAX, &mOperatingMode); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("YearDayIndex", 0, UINT8_MAX, &mYearDayIndex); + AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterSetHolidayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.holidayIndex = [NSNumber numberWithUnsignedChar:mHolidayIndex]; - params.localStartTime = [NSNumber numberWithUnsignedInt:mLocalStartTime]; - params.localEndTime = [NSNumber numberWithUnsignedInt:mLocalEndTime]; - params.operatingMode = [NSNumber numberWithUnsignedChar:mOperatingMode]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setHolidayScheduleWithParams:params - completionHandler:^(NSError * _Nullable error) { + [cluster getYearDayScheduleWithParams:params + completionHandler:^(CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; if (chipError != CHIP_NO_ERROR) { @@ -19614,115 +22510,96 @@ class DoorLockSetHolidaySchedule : public ClusterCommand { } private: - uint8_t mHolidayIndex; - uint32_t mLocalStartTime; - uint32_t mLocalEndTime; - uint8_t mOperatingMode; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type mRequest; + uint8_t mYearDayIndex; + uint16_t mUserIndex; }; /* - * Command SetUser + * Command ClearYearDaySchedule */ -class DoorLockSetUser : public ClusterCommand { +class DoorLockClearYearDaySchedule : public ClusterCommand { public: - DoorLockSetUser() - : ClusterCommand("set-user") + DoorLockClearYearDaySchedule() + : ClusterCommand("clear-year-day-schedule") { - AddArgument("OperationType", 0, UINT8_MAX, &mOperationType); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("YearDayIndex", 0, UINT8_MAX, &mYearDayIndex); AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); - AddArgument("UserName", &mUserName); - AddArgument("UserUniqueId", 0, UINT32_MAX, &mUserUniqueId); - AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); - AddArgument("UserType", 0, UINT8_MAX, &mUserType); - AddArgument("CredentialRule", 0, UINT8_MAX, &mCredentialRule); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterSetUserParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterClearYearDayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.operationType = [NSNumber numberWithUnsignedChar:mOperationType]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; - params.userName = [[NSString alloc] initWithBytes:mUserName.data() length:mUserName.size() encoding:NSUTF8StringEncoding]; - params.userUniqueId = [NSNumber numberWithUnsignedInt:mUserUniqueId]; - params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; - params.userType = [NSNumber numberWithUnsignedChar:mUserType]; - params.credentialRule = [NSNumber numberWithUnsignedChar:mCredentialRule]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setUserWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mOperationType; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type mRequest; + uint8_t mYearDayIndex; uint16_t mUserIndex; - chip::ByteSpan mUserName; - uint32_t mUserUniqueId; - uint8_t mUserStatus; - uint8_t mUserType; - uint8_t mCredentialRule; }; /* - * Command SetWeekDaySchedule + * Command SetHolidaySchedule */ -class DoorLockSetWeekDaySchedule : public ClusterCommand { +class DoorLockSetHolidaySchedule : public ClusterCommand { public: - DoorLockSetWeekDaySchedule() - : ClusterCommand("set-week-day-schedule") + DoorLockSetHolidaySchedule() + : ClusterCommand("set-holiday-schedule") { - AddArgument("WeekDayIndex", 0, UINT8_MAX, &mWeekDayIndex); - AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); - AddArgument("DaysMask", 0, UINT8_MAX, &mDaysMask); - AddArgument("StartHour", 0, UINT8_MAX, &mStartHour); - AddArgument("StartMinute", 0, UINT8_MAX, &mStartMinute); - AddArgument("EndHour", 0, UINT8_MAX, &mEndHour); - AddArgument("EndMinute", 0, UINT8_MAX, &mEndMinute); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("HolidayIndex", 0, UINT8_MAX, &mHolidayIndex); + AddArgument("LocalStartTime", 0, UINT32_MAX, &mLocalStartTime); + AddArgument("LocalEndTime", 0, UINT32_MAX, &mLocalEndTime); + AddArgument("OperatingMode", 0, UINT8_MAX, &mOperatingMode); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterSetWeekDayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterSetHolidayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; - params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; - params.daysMask = [NSNumber numberWithUnsignedChar:mDaysMask]; - params.startHour = [NSNumber numberWithUnsignedChar:mStartHour]; - params.startMinute = [NSNumber numberWithUnsignedChar:mStartMinute]; - params.endHour = [NSNumber numberWithUnsignedChar:mEndHour]; - params.endMinute = [NSNumber numberWithUnsignedChar:mEndMinute]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:mHolidayIndex]; + params.localStartTime = [NSNumber numberWithUnsignedInt:mLocalStartTime]; + params.localEndTime = [NSNumber numberWithUnsignedInt:mLocalEndTime]; + params.operatingMode = [NSNumber numberWithUnsignedChar:mOperatingMode]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setWeekDayScheduleWithParams:params + [cluster setHolidayScheduleWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -19739,49 +22616,44 @@ class DoorLockSetWeekDaySchedule : public ClusterCommand { } private: - uint8_t mWeekDayIndex; - uint16_t mUserIndex; - uint8_t mDaysMask; - uint8_t mStartHour; - uint8_t mStartMinute; - uint8_t mEndHour; - uint8_t mEndMinute; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type mRequest; + uint8_t mHolidayIndex; + uint32_t mLocalStartTime; + uint32_t mLocalEndTime; + uint8_t mOperatingMode; }; /* - * Command SetYearDaySchedule + * Command GetHolidaySchedule */ -class DoorLockSetYearDaySchedule : public ClusterCommand { +class DoorLockGetHolidaySchedule : public ClusterCommand { public: - DoorLockSetYearDaySchedule() - : ClusterCommand("set-year-day-schedule") + DoorLockGetHolidaySchedule() + : ClusterCommand("get-holiday-schedule") { - AddArgument("YearDayIndex", 0, UINT8_MAX, &mYearDayIndex); - AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); - AddArgument("LocalStartTime", 0, UINT32_MAX, &mLocalStartTime); - AddArgument("LocalEndTime", 0, UINT32_MAX, &mLocalEndTime); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("HolidayIndex", 0, UINT8_MAX, &mHolidayIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterGetHolidayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; - params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; - params.localStartTime = [NSNumber numberWithUnsignedInt:mLocalStartTime]; - params.localEndTime = [NSNumber numberWithUnsignedInt:mLocalEndTime]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:mHolidayIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable error) { + [cluster getHolidayScheduleWithParams:params + completionHandler:^(CHIPDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; if (chipError != CHIP_NO_ERROR) { @@ -19797,636 +22669,866 @@ class DoorLockSetYearDaySchedule : public ClusterCommand { } private: - uint8_t mYearDayIndex; - uint16_t mUserIndex; - uint32_t mLocalStartTime; - uint32_t mLocalEndTime; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type mRequest; + uint8_t mHolidayIndex; }; /* - * Command UnlockDoor + * Command ClearHolidaySchedule */ -class DoorLockUnlockDoor : public ClusterCommand { +class DoorLockClearHolidaySchedule : public ClusterCommand { public: - DoorLockUnlockDoor() - : ClusterCommand("unlock-door") + DoorLockClearHolidaySchedule() + : ClusterCommand("clear-holiday-schedule") { - AddArgument("PinCode", &mPinCode); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("HolidayIndex", 0, UINT8_MAX, &mHolidayIndex); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterClearHolidayScheduleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - if (mPinCode.HasValue()) { - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; - } + params.holidayIndex = [NSNumber numberWithUnsignedChar:mHolidayIndex]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster unlockDoorWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster clearHolidayScheduleWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::Optional mPinCode; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type mRequest; + uint8_t mHolidayIndex; }; /* - * Command UnlockWithTimeout + * Command SetUserType */ -class DoorLockUnlockWithTimeout : public ClusterCommand { +class DoorLockSetUserType : public ClusterCommand { public: - DoorLockUnlockWithTimeout() - : ClusterCommand("unlock-with-timeout") + DoorLockSetUserType() + : ClusterCommand("set-user-type") { - AddArgument("Timeout", 0, UINT16_MAX, &mTimeout); - AddArgument("PinCode", &mPinCode); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + AddArgument("UserType", 0, UINT8_MAX, &mUserType); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPDoorLockClusterUnlockWithTimeoutParams alloc] init]; + __auto_type * params = [[CHIPDoorLockClusterSetUserTypeParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.timeout = [NSNumber numberWithUnsignedShort:mTimeout]; - if (mPinCode.HasValue()) { - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; - } + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + params.userType = [NSNumber numberWithUnsignedChar:mUserType]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster unlockWithTimeoutWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster setUserTypeWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mTimeout; - chip::Optional mPinCode; + chip::app::Clusters::DoorLock::Commands::SetUserType::Type mRequest; + uint16_t mUserId; + uint8_t mUserType; }; /* - * Attribute LockState + * Command GetUserType */ -class ReadDoorLockLockState : public ReadAttribute { +class DoorLockGetUserType : public ClusterCommand { public: - ReadDoorLockLockState() - : ReadAttribute("lock-state") + DoorLockGetUserType() + : ClusterCommand("get-user-type") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + ClusterCommand::AddArguments(); } - ~ReadDoorLockLockState() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.LockState response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock LockState read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterGetUserTypeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getUserTypeWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetUserTypeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::DoorLock::Commands::GetUserType::Type mRequest; + uint16_t mUserId; }; -class SubscribeAttributeDoorLockLockState : public SubscribeAttribute { +/* + * Command SetRFIDCode + */ +class DoorLockSetRFIDCode : public ClusterCommand { public: - SubscribeAttributeDoorLockLockState() - : SubscribeAttribute("lock-state") + DoorLockSetRFIDCode() + : ClusterCommand("set-rfidcode") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); + AddArgument("UserType", 0, UINT8_MAX, &mUserType); + AddArgument("RfidCode", &mRfidCode); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeDoorLockLockState() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000016) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLockStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.LockState response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterSetRFIDCodeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; + params.userType = [NSNumber numberWithUnsignedChar:mUserType]; + params.rfidCode = [[NSData alloc] initWithBytes:mRfidCode.data() length:mRfidCode.size()]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setRFIDCodeWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::SetRFIDCode::Type mRequest; + uint16_t mUserId; + uint8_t mUserStatus; + uint8_t mUserType; + chip::ByteSpan mRfidCode; }; /* - * Attribute LockType + * Command GetRFIDCode */ -class ReadDoorLockLockType : public ReadAttribute { +class DoorLockGetRFIDCode : public ClusterCommand { public: - ReadDoorLockLockType() - : ReadAttribute("lock-type") + DoorLockGetRFIDCode() + : ClusterCommand("get-rfidcode") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + ClusterCommand::AddArguments(); } - ~ReadDoorLockLockType() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLockTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.LockType response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock LockType read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterGetRFIDCodeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getRFIDCodeWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetRFIDCodeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::DoorLock::Commands::GetRFIDCode::Type mRequest; + uint16_t mUserId; }; -class SubscribeAttributeDoorLockLockType : public SubscribeAttribute { +/* + * Command ClearRFIDCode + */ +class DoorLockClearRFIDCode : public ClusterCommand { public: - SubscribeAttributeDoorLockLockType() - : SubscribeAttribute("lock-type") + DoorLockClearRFIDCode() + : ClusterCommand("clear-rfidcode") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("RfidSlotIndex", 0, UINT16_MAX, &mRfidSlotIndex); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeDoorLockLockType() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000018) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLockTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.LockType response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterClearRFIDCodeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.rfidSlotIndex = [NSNumber numberWithUnsignedShort:mRfidSlotIndex]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster clearRFIDCodeWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::ClearRFIDCode::Type mRequest; + uint16_t mRfidSlotIndex; }; /* - * Attribute ActuatorEnabled + * Command ClearAllRFIDCodes */ -class ReadDoorLockActuatorEnabled : public ReadAttribute { +class DoorLockClearAllRFIDCodes : public ClusterCommand { public: - ReadDoorLockActuatorEnabled() - : ReadAttribute("actuator-enabled") + DoorLockClearAllRFIDCodes() + : ClusterCommand("clear-all-rfidcodes") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~ReadDoorLockActuatorEnabled() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActuatorEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock ActuatorEnabled read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterClearAllRFIDCodesParams 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 clearAllRFIDCodesWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::DoorLock::Commands::ClearAllRFIDCodes::Type mRequest; }; -class SubscribeAttributeDoorLockActuatorEnabled : public SubscribeAttribute { +/* + * Command SetUser + */ +class DoorLockSetUser : public ClusterCommand { public: - SubscribeAttributeDoorLockActuatorEnabled() - : SubscribeAttribute("actuator-enabled") + DoorLockSetUser() + : ClusterCommand("set-user") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OperationType", 0, UINT8_MAX, &mOperationType); + AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + AddArgument("UserName", &mUserName); + AddArgument("UserUniqueId", 0, UINT32_MAX, &mUserUniqueId); + AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); + AddArgument("UserType", 0, UINT8_MAX, &mUserType); + AddArgument("CredentialRule", 0, UINT8_MAX, &mCredentialRule); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeDoorLockActuatorEnabled() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeActuatorEnabledWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterSetUserParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.operationType = [NSNumber numberWithUnsignedChar:mOperationType]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.userName = [[NSString alloc] initWithBytes:mUserName.data() length:mUserName.size() encoding:NSUTF8StringEncoding]; + params.userUniqueId = [NSNumber numberWithUnsignedInt:mUserUniqueId]; + params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; + params.userType = [NSNumber numberWithUnsignedChar:mUserType]; + params.credentialRule = [NSNumber numberWithUnsignedChar:mCredentialRule]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::SetUser::Type mRequest; + uint8_t mOperationType; + uint16_t mUserIndex; + chip::ByteSpan mUserName; + uint32_t mUserUniqueId; + uint8_t mUserStatus; + uint8_t mUserType; + uint8_t mCredentialRule; }; /* - * Attribute DoorState + * Command GetUser */ -class ReadDoorLockDoorState : public ReadAttribute { +class DoorLockGetUser : public ClusterCommand { public: - ReadDoorLockDoorState() - : ReadAttribute("door-state") + DoorLockGetUser() + : ClusterCommand("get-user") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + ClusterCommand::AddArguments(); } - ~ReadDoorLockDoorState() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDoorStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.DoorState response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock DoorState read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterGetUserParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getUserWithParams:params + completionHandler:^(CHIPDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::DoorLock::Commands::GetUser::Type mRequest; + uint16_t mUserIndex; }; -class SubscribeAttributeDoorLockDoorState : public SubscribeAttribute { +/* + * Command ClearUser + */ +class DoorLockClearUser : public ClusterCommand { public: - SubscribeAttributeDoorLockDoorState() - : SubscribeAttribute("door-state") + DoorLockClearUser() + : ClusterCommand("clear-user") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeDoorLockDoorState() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDoorStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.DoorState response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterClearUserParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::ClearUser::Type mRequest; + uint16_t mUserIndex; }; /* - * Attribute NumberOfTotalUsersSupported + * Command SetCredential */ -class ReadDoorLockNumberOfTotalUsersSupported : public ReadAttribute { +class DoorLockSetCredential : public ClusterCommand { public: - ReadDoorLockNumberOfTotalUsersSupported() - : ReadAttribute("number-of-total-users-supported") + DoorLockSetCredential() + : ClusterCommand("set-credential") + , mComplex_Credential(&mRequest.credential) { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OperationType", 0, UINT8_MAX, &mOperationType); + AddArgument("Credential", &mComplex_Credential); + AddArgument("CredentialData", &mCredentialData); + AddArgument("UserIndex", 0, UINT16_MAX, &mUserIndex); + AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); + AddArgument("UserType", 0, UINT8_MAX, &mUserType); + ClusterCommand::AddArguments(); } - ~ReadDoorLockNumberOfTotalUsersSupported() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock NumberOfTotalUsersSupported read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.operationType = [NSNumber numberWithUnsignedChar:mOperationType]; + params.credential = [CHIPDoorLockClusterDlCredential new]; + params.credential.credentialType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.credentialType)]; + params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.credentialIndex]; + params.credentialData = [[NSData alloc] initWithBytes:mCredentialData.data() length:mCredentialData.size()]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; + params.userType = [NSNumber numberWithUnsignedChar:mUserType]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setCredentialWithParams:params + completionHandler:^( + CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::DoorLock::Commands::SetCredential::Type mRequest; + uint8_t mOperationType; + TypedComplexArgument mComplex_Credential; + chip::ByteSpan mCredentialData; + uint16_t mUserIndex; + uint8_t mUserStatus; + uint8_t mUserType; }; -class SubscribeAttributeDoorLockNumberOfTotalUsersSupported : public SubscribeAttribute { +/* + * Command GetCredentialStatus + */ +class DoorLockGetCredentialStatus : public ClusterCommand { public: - SubscribeAttributeDoorLockNumberOfTotalUsersSupported() - : SubscribeAttribute("number-of-total-users-supported") + DoorLockGetCredentialStatus() + : ClusterCommand("get-credential-status") + , mComplex_Credential(&mRequest.credential) { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Credential", &mComplex_Credential); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeDoorLockNumberOfTotalUsersSupported() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000024) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNumberOfTotalUsersSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterGetCredentialStatusParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.credential = [CHIPDoorLockClusterDlCredential new]; + params.credential.credentialType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.credentialType)]; + params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.credentialIndex]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getCredentialStatusWithParams:params + completionHandler:^(CHIPDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type mRequest; + TypedComplexArgument mComplex_Credential; }; /* - * Attribute NumberOfPINUsersSupported + * Command ClearCredential */ -class ReadDoorLockNumberOfPINUsersSupported : public ReadAttribute { +class DoorLockClearCredential : public ClusterCommand { public: - ReadDoorLockNumberOfPINUsersSupported() - : ReadAttribute("number-of-pinusers-supported") + DoorLockClearCredential() + : ClusterCommand("clear-credential") + , mComplex_Credential(&mRequest.credential) { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Credential", &mComplex_Credential); + ClusterCommand::AddArguments(); } - ~ReadDoorLockNumberOfPINUsersSupported() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeNumberOfPINUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock NumberOfPINUsersSupported read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + if (mRequest.credential.IsNull()) { + params.credential = nil; + } else { + params.credential = [CHIPDoorLockClusterDlCredential new]; + params.credential.credentialType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.Value().credentialType)]; + params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.Value().credentialIndex]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type mRequest; + TypedComplexArgument> + mComplex_Credential; }; -class SubscribeAttributeDoorLockNumberOfPINUsersSupported : public SubscribeAttribute { +/* + * Command OperatingEventNotification + */ +class DoorLockOperatingEventNotification : public ClusterCommand { public: - SubscribeAttributeDoorLockNumberOfPINUsersSupported() - : SubscribeAttribute("number-of-pinusers-supported") + DoorLockOperatingEventNotification() + : ClusterCommand("operating-event-notification") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OperationEventSource", 0, UINT8_MAX, &mOperationEventSource); + AddArgument("OperationEventCode", 0, UINT8_MAX, &mOperationEventCode); + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + AddArgument("Pin", &mPin); + AddArgument("LocalTime", 0, UINT32_MAX, &mLocalTime); + AddArgument("Data", &mData); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeDoorLockNumberOfPINUsersSupported() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNumberOfPINUsersSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterOperatingEventNotificationParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.operationEventSource = [NSNumber numberWithUnsignedChar:mOperationEventSource]; + params.operationEventCode = [NSNumber numberWithUnsignedChar:mOperationEventCode]; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + params.pin = [[NSData alloc] initWithBytes:mPin.data() length:mPin.size()]; + params.localTime = [NSNumber numberWithUnsignedInt:mLocalTime]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster operatingEventNotificationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::OperatingEventNotification::Type mRequest; + uint8_t mOperationEventSource; + uint8_t mOperationEventCode; + uint16_t mUserId; + chip::ByteSpan mPin; + uint32_t mLocalTime; + chip::Optional mData; }; /* - * Attribute NumberOfRFIDUsersSupported + * Command ProgrammingEventNotification */ -class ReadDoorLockNumberOfRFIDUsersSupported : public ReadAttribute { +class DoorLockProgrammingEventNotification : public ClusterCommand { public: - ReadDoorLockNumberOfRFIDUsersSupported() - : ReadAttribute("number-of-rfidusers-supported") + DoorLockProgrammingEventNotification() + : ClusterCommand("programming-event-notification") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ProgramEventSource", 0, UINT8_MAX, &mProgramEventSource); + AddArgument("ProgramEventCode", 0, UINT8_MAX, &mProgramEventCode); + AddArgument("UserId", 0, UINT16_MAX, &mUserId); + AddArgument("Pin", &mPin); + AddArgument("UserType", 0, UINT8_MAX, &mUserType); + AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus); + AddArgument("LocalTime", 0, UINT32_MAX, &mLocalTime); + AddArgument("Data", &mData); + ClusterCommand::AddArguments(); } - ~ReadDoorLockNumberOfRFIDUsersSupported() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeNumberOfRFIDUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock NumberOfRFIDUsersSupported read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class SubscribeAttributeDoorLockNumberOfRFIDUsersSupported : public SubscribeAttribute { -public: - SubscribeAttributeDoorLockNumberOfRFIDUsersSupported() - : SubscribeAttribute("number-of-rfidusers-supported") - { - } - - ~SubscribeAttributeDoorLockNumberOfRFIDUsersSupported() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000013) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNumberOfRFIDUsersSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterProgrammingEventNotificationParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.programEventSource = [NSNumber numberWithUnsignedChar:mProgramEventSource]; + params.programEventCode = [NSNumber numberWithUnsignedChar:mProgramEventCode]; + params.userId = [NSNumber numberWithUnsignedShort:mUserId]; + params.pin = [[NSData alloc] initWithBytes:mPin.data() length:mPin.size()]; + params.userType = [NSNumber numberWithUnsignedChar:mUserType]; + params.userStatus = [NSNumber numberWithUnsignedChar:mUserStatus]; + params.localTime = [NSNumber numberWithUnsignedInt:mLocalTime]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster programmingEventNotificationWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::DoorLock::Commands::ProgrammingEventNotification::Type mRequest; + uint8_t mProgramEventSource; + uint8_t mProgramEventCode; + uint16_t mUserId; + chip::ByteSpan mPin; + uint8_t mUserType; + uint8_t mUserStatus; + uint32_t mLocalTime; + chip::Optional mData; }; /* - * Attribute NumberOfWeekDaySchedulesSupportedPerUser + * Attribute LockState */ -class ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public ReadAttribute { +class ReadDoorLockLockState : public ReadAttribute { public: - ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser() - : ReadAttribute("number-of-week-day-schedules-supported-per-user") + ReadDoorLockLockState() + : ReadAttribute("lock-state") { } - ~ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser() {} + ~ReadDoorLockLockState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfWeekDaySchedulesSupportedPerUser response %@", [value description]); + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LockState response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock NumberOfWeekDaySchedulesSupportedPerUser read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock LockState read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20434,40 +23536,34 @@ class ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public ReadAttribut } }; -class SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public SubscribeAttribute { +class SubscribeAttributeDoorLockLockState : public SubscribeAttribute { public: - SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser() - : SubscribeAttribute("number-of-week-day-schedules-supported-per-user") + SubscribeAttributeDoorLockLockState() + : SubscribeAttribute("lock-state") { } - ~SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser() {} + ~SubscribeAttributeDoorLockLockState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNumberOfWeekDaySchedulesSupportedPerUserWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock." - @"NumberOfWeekDaySchedulesSupportedPerUser " - @"response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus( - [CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLockStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LockState response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -20479,31 +23575,30 @@ class SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser : publi }; /* - * Attribute NumberOfYearDaySchedulesSupportedPerUser + * Attribute LockType */ -class ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser : public ReadAttribute { +class ReadDoorLockLockType : public ReadAttribute { public: - ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser() - : ReadAttribute("number-of-year-day-schedules-supported-per-user") + ReadDoorLockLockType() + : ReadAttribute("lock-type") { } - ~ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser() {} + ~ReadDoorLockLockType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfYearDaySchedulesSupportedPerUser response %@", [value description]); + [cluster readAttributeLockTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LockType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock NumberOfYearDaySchedulesSupportedPerUser read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock LockType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20511,40 +23606,34 @@ class ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser : public ReadAttribut } }; -class SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser : public SubscribeAttribute { +class SubscribeAttributeDoorLockLockType : public SubscribeAttribute { public: - SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser() - : SubscribeAttribute("number-of-year-day-schedules-supported-per-user") + SubscribeAttributeDoorLockLockType() + : SubscribeAttribute("lock-type") { } - ~SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser() {} + ~SubscribeAttributeDoorLockLockType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNumberOfYearDaySchedulesSupportedPerUserWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock." - @"NumberOfYearDaySchedulesSupportedPerUser " - @"response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus( - [CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLockTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LockType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -20556,31 +23645,30 @@ class SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser : publi }; /* - * Attribute NumberOfHolidaySchedulesSupported + * Attribute ActuatorEnabled */ -class ReadDoorLockNumberOfHolidaySchedulesSupported : public ReadAttribute { +class ReadDoorLockActuatorEnabled : public ReadAttribute { public: - ReadDoorLockNumberOfHolidaySchedulesSupported() - : ReadAttribute("number-of-holiday-schedules-supported") + ReadDoorLockActuatorEnabled() + : ReadAttribute("actuator-enabled") { } - ~ReadDoorLockNumberOfHolidaySchedulesSupported() {} + ~ReadDoorLockActuatorEnabled() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.NumberOfHolidaySchedulesSupported response %@", [value description]); + [cluster readAttributeActuatorEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock NumberOfHolidaySchedulesSupported read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock ActuatorEnabled read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20588,39 +23676,34 @@ class ReadDoorLockNumberOfHolidaySchedulesSupported : public ReadAttribute { } }; -class SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported : public SubscribeAttribute { +class SubscribeAttributeDoorLockActuatorEnabled : public SubscribeAttribute { public: - SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported() - : SubscribeAttribute("number-of-holiday-schedules-supported") + SubscribeAttributeDoorLockActuatorEnabled() + : SubscribeAttribute("actuator-enabled") { } - ~SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported() {} + ~SubscribeAttributeDoorLockActuatorEnabled() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNumberOfHolidaySchedulesSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog( - @"DoorLock.NumberOfHolidaySchedulesSupported response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus( - [CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActuatorEnabledWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -20632,30 +23715,30 @@ class SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported : public Subsc }; /* - * Attribute MaxPINCodeLength + * Attribute DoorState */ -class ReadDoorLockMaxPINCodeLength : public ReadAttribute { +class ReadDoorLockDoorState : public ReadAttribute { public: - ReadDoorLockMaxPINCodeLength() - : ReadAttribute("max-pincode-length") + ReadDoorLockDoorState() + : ReadAttribute("door-state") { } - ~ReadDoorLockMaxPINCodeLength() {} + ~ReadDoorLockDoorState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); + [cluster readAttributeDoorStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DoorState response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock MaxPINCodeLength read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock DoorState read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20663,34 +23746,34 @@ class ReadDoorLockMaxPINCodeLength : public ReadAttribute { } }; -class SubscribeAttributeDoorLockMaxPINCodeLength : public SubscribeAttribute { +class SubscribeAttributeDoorLockDoorState : public SubscribeAttribute { public: - SubscribeAttributeDoorLockMaxPINCodeLength() - : SubscribeAttribute("max-pincode-length") + SubscribeAttributeDoorLockDoorState() + : SubscribeAttribute("door-state") { } - ~SubscribeAttributeDoorLockMaxPINCodeLength() {} + ~SubscribeAttributeDoorLockDoorState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxPINCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDoorStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DoorState response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -20702,30 +23785,30 @@ class SubscribeAttributeDoorLockMaxPINCodeLength : public SubscribeAttribute { }; /* - * Attribute MinPINCodeLength + * Attribute DoorOpenEvents */ -class ReadDoorLockMinPINCodeLength : public ReadAttribute { +class ReadDoorLockDoorOpenEvents : public ReadAttribute { public: - ReadDoorLockMinPINCodeLength() - : ReadAttribute("min-pincode-length") + ReadDoorLockDoorOpenEvents() + : ReadAttribute("door-open-events") { } - ~ReadDoorLockMinPINCodeLength() {} + ~ReadDoorLockDoorOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); + [cluster readAttributeDoorOpenEventsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DoorOpenEvents response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock MinPINCodeLength read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock DoorOpenEvents read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20733,104 +23816,74 @@ class ReadDoorLockMinPINCodeLength : public ReadAttribute { } }; -class SubscribeAttributeDoorLockMinPINCodeLength : public SubscribeAttribute { +class WriteDoorLockDoorOpenEvents : public WriteAttribute { public: - SubscribeAttributeDoorLockMinPINCodeLength() - : SubscribeAttribute("min-pincode-length") + WriteDoorLockDoorOpenEvents() + : WriteAttribute("door-open-events") { + AddArgument("attr-name", "door-open-events"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeDoorLockMinPINCodeLength() {} + ~WriteDoorLockDoorOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinPINCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } -}; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; -/* - * Attribute MaxRFIDCodeLength - */ -class ReadDoorLockMaxRFIDCodeLength : public ReadAttribute { -public: - ReadDoorLockMaxRFIDCodeLength() - : ReadAttribute("max-rfidcode-length") - { + [cluster writeAttributeDoorOpenEventsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "DoorLock DoorOpenEvents write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } - ~ReadDoorLockMaxRFIDCodeLength() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000019) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock MaxRFIDCodeLength read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } +private: + uint32_t mValue; }; -class SubscribeAttributeDoorLockMaxRFIDCodeLength : public SubscribeAttribute { +class SubscribeAttributeDoorLockDoorOpenEvents : public SubscribeAttribute { public: - SubscribeAttributeDoorLockMaxRFIDCodeLength() - : SubscribeAttribute("max-rfidcode-length") + SubscribeAttributeDoorLockDoorOpenEvents() + : SubscribeAttribute("door-open-events") { } - ~SubscribeAttributeDoorLockMaxRFIDCodeLength() {} + ~SubscribeAttributeDoorLockDoorOpenEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxRFIDCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDoorOpenEventsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DoorOpenEvents response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -20842,30 +23895,30 @@ class SubscribeAttributeDoorLockMaxRFIDCodeLength : public SubscribeAttribute { }; /* - * Attribute MinRFIDCodeLength + * Attribute DoorClosedEvents */ -class ReadDoorLockMinRFIDCodeLength : public ReadAttribute { +class ReadDoorLockDoorClosedEvents : public ReadAttribute { public: - ReadDoorLockMinRFIDCodeLength() - : ReadAttribute("min-rfidcode-length") + ReadDoorLockDoorClosedEvents() + : ReadAttribute("door-closed-events") { } - ~ReadDoorLockMinRFIDCodeLength() {} + ~ReadDoorLockDoorClosedEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); + [cluster readAttributeDoorClosedEventsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DoorClosedEvents response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock MinRFIDCodeLength read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock DoorClosedEvents read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20873,34 +23926,74 @@ class ReadDoorLockMinRFIDCodeLength : public ReadAttribute { } }; -class SubscribeAttributeDoorLockMinRFIDCodeLength : public SubscribeAttribute { +class WriteDoorLockDoorClosedEvents : public WriteAttribute { public: - SubscribeAttributeDoorLockMinRFIDCodeLength() - : SubscribeAttribute("min-rfidcode-length") + WriteDoorLockDoorClosedEvents() + : WriteAttribute("door-closed-events") { + AddArgument("attr-name", "door-closed-events"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeDoorLockMinRFIDCodeLength() {} + ~WriteDoorLockDoorClosedEvents() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeDoorClosedEventsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock DoorClosedEvents write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeDoorLockDoorClosedEvents : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockDoorClosedEvents() + : SubscribeAttribute("door-closed-events") + { + } + + ~SubscribeAttributeDoorLockDoorClosedEvents() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinRFIDCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDoorClosedEventsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DoorClosedEvents response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -20912,30 +24005,30 @@ class SubscribeAttributeDoorLockMinRFIDCodeLength : public SubscribeAttribute { }; /* - * Attribute Language + * Attribute OpenPeriod */ -class ReadDoorLockLanguage : public ReadAttribute { +class ReadDoorLockOpenPeriod : public ReadAttribute { public: - ReadDoorLockLanguage() - : ReadAttribute("language") + ReadDoorLockOpenPeriod() + : ReadAttribute("open-period") { } - ~ReadDoorLockLanguage() {} + ~ReadDoorLockOpenPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLanguageWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.Language response %@", [value description]); + [cluster readAttributeOpenPeriodWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.OpenPeriod response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock Language read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock OpenPeriod read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -20943,75 +24036,73 @@ class ReadDoorLockLanguage : public ReadAttribute { } }; -class WriteDoorLockLanguage : public WriteAttribute { +class WriteDoorLockOpenPeriod : public WriteAttribute { public: - WriteDoorLockLanguage() - : WriteAttribute("language") + WriteDoorLockOpenPeriod() + : WriteAttribute("open-period") { - AddArgument("attr-name", "language"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "open-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteDoorLockLanguage() {} + ~WriteDoorLockOpenPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeLanguageWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock Language write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeOpenPeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock OpenPeriod write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mValue; + uint16_t mValue; }; -class SubscribeAttributeDoorLockLanguage : public SubscribeAttribute { +class SubscribeAttributeDoorLockOpenPeriod : public SubscribeAttribute { public: - SubscribeAttributeDoorLockLanguage() - : SubscribeAttribute("language") + SubscribeAttributeDoorLockOpenPeriod() + : SubscribeAttribute("open-period") { } - ~SubscribeAttributeDoorLockLanguage() {} + ~SubscribeAttributeDoorLockOpenPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLanguageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.Language response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOpenPeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.OpenPeriod response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21023,105 +24114,68 @@ class SubscribeAttributeDoorLockLanguage : public SubscribeAttribute { }; /* - * Attribute AutoRelockTime + * Attribute NumberOfLogRecordsSupported */ -class ReadDoorLockAutoRelockTime : public ReadAttribute { +class ReadDoorLockNumberOfLogRecordsSupported : public ReadAttribute { public: - ReadDoorLockAutoRelockTime() - : ReadAttribute("auto-relock-time") + ReadDoorLockNumberOfLogRecordsSupported() + : ReadAttribute("number-of-log-records-supported") { } - ~ReadDoorLockAutoRelockTime() {} + ~ReadDoorLockNumberOfLogRecordsSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000023) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "DoorLock AutoRelockTime read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class WriteDoorLockAutoRelockTime : public WriteAttribute { -public: - WriteDoorLockAutoRelockTime() - : WriteAttribute("auto-relock-time") - { - AddArgument("attr-name", "auto-relock-time"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDoorLockAutoRelockTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000023) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + [cluster + readAttributeNumberOfLogRecordsSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfLogRecordsSupported response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - [cluster writeAttributeAutoRelockTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "DoorLock AutoRelockTime write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + if (error != nil) { + ChipLogError(chipTool, "DoorLock NumberOfLogRecordsSupported read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } - -private: - uint32_t mValue; }; -class SubscribeAttributeDoorLockAutoRelockTime : public SubscribeAttribute { +class SubscribeAttributeDoorLockNumberOfLogRecordsSupported : public SubscribeAttribute { public: - SubscribeAttributeDoorLockAutoRelockTime() - : SubscribeAttribute("auto-relock-time") + SubscribeAttributeDoorLockNumberOfLogRecordsSupported() + : SubscribeAttribute("number-of-log-records-supported") { } - ~SubscribeAttributeDoorLockAutoRelockTime() {} + ~SubscribeAttributeDoorLockNumberOfLogRecordsSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000023) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAutoRelockTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNumberOfLogRecordsSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfLogRecordsSupported response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21133,104 +24187,68 @@ class SubscribeAttributeDoorLockAutoRelockTime : public SubscribeAttribute { }; /* - * Attribute SoundVolume + * Attribute NumberOfTotalUsersSupported */ -class ReadDoorLockSoundVolume : public ReadAttribute { +class ReadDoorLockNumberOfTotalUsersSupported : public ReadAttribute { public: - ReadDoorLockSoundVolume() - : ReadAttribute("sound-volume") + ReadDoorLockNumberOfTotalUsersSupported() + : ReadAttribute("number-of-total-users-supported") { } - ~ReadDoorLockSoundVolume() {} + ~ReadDoorLockNumberOfTotalUsersSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSoundVolumeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.SoundVolume response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock SoundVolume read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock NumberOfTotalUsersSupported read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteDoorLockSoundVolume : public WriteAttribute { -public: - WriteDoorLockSoundVolume() - : WriteAttribute("sound-volume") - { - AddArgument("attr-name", "sound-volume"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDoorLockSoundVolume() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000024) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeSoundVolumeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock SoundVolume write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeDoorLockSoundVolume : public SubscribeAttribute { +class SubscribeAttributeDoorLockNumberOfTotalUsersSupported : public SubscribeAttribute { public: - SubscribeAttributeDoorLockSoundVolume() - : SubscribeAttribute("sound-volume") + SubscribeAttributeDoorLockNumberOfTotalUsersSupported() + : SubscribeAttribute("number-of-total-users-supported") { } - ~SubscribeAttributeDoorLockSoundVolume() {} + ~SubscribeAttributeDoorLockNumberOfTotalUsersSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSoundVolumeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.SoundVolume response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNumberOfTotalUsersSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21242,105 +24260,68 @@ class SubscribeAttributeDoorLockSoundVolume : public SubscribeAttribute { }; /* - * Attribute OperatingMode + * Attribute NumberOfPINUsersSupported */ -class ReadDoorLockOperatingMode : public ReadAttribute { +class ReadDoorLockNumberOfPINUsersSupported : public ReadAttribute { public: - ReadDoorLockOperatingMode() - : ReadAttribute("operating-mode") + ReadDoorLockNumberOfPINUsersSupported() + : ReadAttribute("number-of-pinusers-supported") { } - ~ReadDoorLockOperatingMode() {} + ~ReadDoorLockNumberOfPINUsersSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOperatingModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.OperatingMode response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeNumberOfPINUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock OperatingMode read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock NumberOfPINUsersSupported read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteDoorLockOperatingMode : public WriteAttribute { -public: - WriteDoorLockOperatingMode() - : WriteAttribute("operating-mode") - { - AddArgument("attr-name", "operating-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDoorLockOperatingMode() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000025) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster - writeAttributeOperatingModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock OperatingMode write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeDoorLockOperatingMode : public SubscribeAttribute { +class SubscribeAttributeDoorLockNumberOfPINUsersSupported : public SubscribeAttribute { public: - SubscribeAttributeDoorLockOperatingMode() - : SubscribeAttribute("operating-mode") + SubscribeAttributeDoorLockNumberOfPINUsersSupported() + : SubscribeAttribute("number-of-pinusers-supported") { } - ~SubscribeAttributeDoorLockOperatingMode() {} + ~SubscribeAttributeDoorLockNumberOfPINUsersSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOperatingModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.OperatingMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNumberOfPINUsersSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21352,31 +24333,31 @@ class SubscribeAttributeDoorLockOperatingMode : public SubscribeAttribute { }; /* - * Attribute SupportedOperatingModes + * Attribute NumberOfRFIDUsersSupported */ -class ReadDoorLockSupportedOperatingModes : public ReadAttribute { +class ReadDoorLockNumberOfRFIDUsersSupported : public ReadAttribute { public: - ReadDoorLockSupportedOperatingModes() - : ReadAttribute("supported-operating-modes") + ReadDoorLockNumberOfRFIDUsersSupported() + : ReadAttribute("number-of-rfidusers-supported") { } - ~ReadDoorLockSupportedOperatingModes() {} + ~ReadDoorLockNumberOfRFIDUsersSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster - readAttributeSupportedOperatingModesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.SupportedOperatingModes response %@", [value description]); + readAttributeNumberOfRFIDUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock SupportedOperatingModes read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock NumberOfRFIDUsersSupported read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -21384,35 +24365,36 @@ class ReadDoorLockSupportedOperatingModes : public ReadAttribute { } }; -class SubscribeAttributeDoorLockSupportedOperatingModes : public SubscribeAttribute { +class SubscribeAttributeDoorLockNumberOfRFIDUsersSupported : public SubscribeAttribute { public: - SubscribeAttributeDoorLockSupportedOperatingModes() - : SubscribeAttribute("supported-operating-modes") + SubscribeAttributeDoorLockNumberOfRFIDUsersSupported() + : SubscribeAttribute("number-of-rfidusers-supported") { } - ~SubscribeAttributeDoorLockSupportedOperatingModes() {} + ~SubscribeAttributeDoorLockNumberOfRFIDUsersSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSupportedOperatingModesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.SupportedOperatingModes response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNumberOfRFIDUsersSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21424,30 +24406,31 @@ class SubscribeAttributeDoorLockSupportedOperatingModes : public SubscribeAttrib }; /* - * Attribute EnableOneTouchLocking + * Attribute NumberOfWeekDaySchedulesSupportedPerUser */ -class ReadDoorLockEnableOneTouchLocking : public ReadAttribute { +class ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public ReadAttribute { public: - ReadDoorLockEnableOneTouchLocking() - : ReadAttribute("enable-one-touch-locking") + ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser() + : ReadAttribute("number-of-week-day-schedules-supported-per-user") { } - ~ReadDoorLockEnableOneTouchLocking() {} + ~ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEnableOneTouchLockingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); + [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfWeekDaySchedulesSupportedPerUser response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock EnableOneTouchLocking read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock NumberOfWeekDaySchedulesSupportedPerUser read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -21455,58 +24438,95 @@ class ReadDoorLockEnableOneTouchLocking : public ReadAttribute { } }; -class WriteDoorLockEnableOneTouchLocking : public WriteAttribute { +class SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public SubscribeAttribute { public: - WriteDoorLockEnableOneTouchLocking() - : WriteAttribute("enable-one-touch-locking") + SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser() + : SubscribeAttribute("number-of-week-day-schedules-supported-per-user") { - AddArgument("attr-name", "enable-one-touch-locking"); - AddArgument("attr-value", 0, 1, &mValue); - WriteAttribute::AddArguments(); } - ~WriteDoorLockEnableOneTouchLocking() {} + ~SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeNumberOfWeekDaySchedulesSupportedPerUserWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock." + @"NumberOfWeekDaySchedulesSupportedPerUser " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeEnableOneTouchLockingWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock EnableOneTouchLocking write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - bool mValue; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; -class SubscribeAttributeDoorLockEnableOneTouchLocking : public SubscribeAttribute { +/* + * Attribute NumberOfYearDaySchedulesSupportedPerUser + */ +class ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser : public ReadAttribute { public: - SubscribeAttributeDoorLockEnableOneTouchLocking() - : SubscribeAttribute("enable-one-touch-locking") + ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser() + : ReadAttribute("number-of-year-day-schedules-supported-per-user") { } - ~SubscribeAttributeDoorLockEnableOneTouchLocking() {} + ~ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfYearDaySchedulesSupportedPerUser response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "DoorLock NumberOfYearDaySchedulesSupportedPerUser read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser() + : SubscribeAttribute("number-of-year-day-schedules-supported-per-user") + { + } + + ~SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -21514,16 +24534,21 @@ class SubscribeAttributeDoorLockEnableOneTouchLocking : public SubscribeAttribut = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeEnableOneTouchLockingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeNumberOfYearDaySchedulesSupportedPerUserWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock." + @"NumberOfYearDaySchedulesSupportedPerUser " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21535,107 +24560,71 @@ class SubscribeAttributeDoorLockEnableOneTouchLocking : public SubscribeAttribut }; /* - * Attribute EnablePrivacyModeButton + * Attribute NumberOfHolidaySchedulesSupported */ -class ReadDoorLockEnablePrivacyModeButton : public ReadAttribute { +class ReadDoorLockNumberOfHolidaySchedulesSupported : public ReadAttribute { public: - ReadDoorLockEnablePrivacyModeButton() - : ReadAttribute("enable-privacy-mode-button") + ReadDoorLockNumberOfHolidaySchedulesSupported() + : ReadAttribute("number-of-holiday-schedules-supported") { } - ~ReadDoorLockEnablePrivacyModeButton() {} + ~ReadDoorLockNumberOfHolidaySchedulesSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000002B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeEnablePrivacyModeButtonWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.EnablePrivacyModeButton response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.NumberOfHolidaySchedulesSupported response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock EnablePrivacyModeButton read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock NumberOfHolidaySchedulesSupported read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteDoorLockEnablePrivacyModeButton : public WriteAttribute { +class SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported : public SubscribeAttribute { public: - WriteDoorLockEnablePrivacyModeButton() - : WriteAttribute("enable-privacy-mode-button") + SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported() + : SubscribeAttribute("number-of-holiday-schedules-supported") { - AddArgument("attr-name", "enable-privacy-mode-button"); - AddArgument("attr-value", 0, 1, &mValue); - WriteAttribute::AddArguments(); } - ~WriteDoorLockEnablePrivacyModeButton() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x0000002B) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - - [cluster writeAttributeEnablePrivacyModeButtonWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock EnablePrivacyModeButton write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - bool mValue; -}; - -class SubscribeAttributeDoorLockEnablePrivacyModeButton : public SubscribeAttribute { -public: - SubscribeAttributeDoorLockEnablePrivacyModeButton() - : SubscribeAttribute("enable-privacy-mode-button") - { - } - - ~SubscribeAttributeDoorLockEnablePrivacyModeButton() {} + ~SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000002B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEnablePrivacyModeButtonWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.EnablePrivacyModeButton response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNumberOfHolidaySchedulesSupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog( + @"DoorLock.NumberOfHolidaySchedulesSupported response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21647,30 +24636,30 @@ class SubscribeAttributeDoorLockEnablePrivacyModeButton : public SubscribeAttrib }; /* - * Attribute WrongCodeEntryLimit + * Attribute MaxPINCodeLength */ -class ReadDoorLockWrongCodeEntryLimit : public ReadAttribute { +class ReadDoorLockMaxPINCodeLength : public ReadAttribute { public: - ReadDoorLockWrongCodeEntryLimit() - : ReadAttribute("wrong-code-entry-limit") + ReadDoorLockMaxPINCodeLength() + : ReadAttribute("max-pincode-length") { } - ~ReadDoorLockWrongCodeEntryLimit() {} + ~ReadDoorLockMaxPINCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000030) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWrongCodeEntryLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); + [cluster readAttributeMaxPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock WrongCodeEntryLimit read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock MaxPINCodeLength read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -21678,74 +24667,34 @@ class ReadDoorLockWrongCodeEntryLimit : public ReadAttribute { } }; -class WriteDoorLockWrongCodeEntryLimit : public WriteAttribute { -public: - WriteDoorLockWrongCodeEntryLimit() - : WriteAttribute("wrong-code-entry-limit") - { - AddArgument("attr-name", "wrong-code-entry-limit"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDoorLockWrongCodeEntryLimit() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000030) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeWrongCodeEntryLimitWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "DoorLock WrongCodeEntryLimit write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeDoorLockWrongCodeEntryLimit : public SubscribeAttribute { +class SubscribeAttributeDoorLockMaxPINCodeLength : public SubscribeAttribute { public: - SubscribeAttributeDoorLockWrongCodeEntryLimit() - : SubscribeAttribute("wrong-code-entry-limit") + SubscribeAttributeDoorLockMaxPINCodeLength() + : SubscribeAttribute("max-pincode-length") { } - ~SubscribeAttributeDoorLockWrongCodeEntryLimit() {} + ~SubscribeAttributeDoorLockMaxPINCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000030) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeWrongCodeEntryLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMaxPINCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21757,31 +24706,30 @@ class SubscribeAttributeDoorLockWrongCodeEntryLimit : public SubscribeAttribute }; /* - * Attribute UserCodeTemporaryDisableTime + * Attribute MinPINCodeLength */ -class ReadDoorLockUserCodeTemporaryDisableTime : public ReadAttribute { +class ReadDoorLockMinPINCodeLength : public ReadAttribute { public: - ReadDoorLockUserCodeTemporaryDisableTime() - : ReadAttribute("user-code-temporary-disable-time") + ReadDoorLockMinPINCodeLength() + : ReadAttribute("min-pincode-length") { } - ~ReadDoorLockUserCodeTemporaryDisableTime() {} + ~ReadDoorLockMinPINCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000031) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeUserCodeTemporaryDisableTimeWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", [value description]); + [cluster readAttributeMinPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock UserCodeTemporaryDisableTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock MinPINCodeLength read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -21789,77 +24737,34 @@ class ReadDoorLockUserCodeTemporaryDisableTime : public ReadAttribute { } }; -class WriteDoorLockUserCodeTemporaryDisableTime : public WriteAttribute { -public: - WriteDoorLockUserCodeTemporaryDisableTime() - : WriteAttribute("user-code-temporary-disable-time") - { - AddArgument("attr-name", "user-code-temporary-disable-time"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDoorLockUserCodeTemporaryDisableTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000031) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeUserCodeTemporaryDisableTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "DoorLock UserCodeTemporaryDisableTime write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeDoorLockUserCodeTemporaryDisableTime : public SubscribeAttribute { +class SubscribeAttributeDoorLockMinPINCodeLength : public SubscribeAttribute { public: - SubscribeAttributeDoorLockUserCodeTemporaryDisableTime() - : SubscribeAttribute("user-code-temporary-disable-time") + SubscribeAttributeDoorLockMinPINCodeLength() + : SubscribeAttribute("min-pincode-length") { } - ~SubscribeAttributeDoorLockUserCodeTemporaryDisableTime() {} + ~SubscribeAttributeDoorLockMinPINCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000031) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeUserCodeTemporaryDisableTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMinPINCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -21871,31 +24776,30 @@ class SubscribeAttributeDoorLockUserCodeTemporaryDisableTime : public SubscribeA }; /* - * Attribute RequirePINforRemoteOperation + * Attribute MaxRFIDCodeLength */ -class ReadDoorLockRequirePINforRemoteOperation : public ReadAttribute { +class ReadDoorLockMaxRFIDCodeLength : public ReadAttribute { public: - ReadDoorLockRequirePINforRemoteOperation() - : ReadAttribute("require-pinfor-remote-operation") + ReadDoorLockMaxRFIDCodeLength() + : ReadAttribute("max-rfidcode-length") { } - ~ReadDoorLockRequirePINforRemoteOperation() {} + ~ReadDoorLockMaxRFIDCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000033) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRequirePINforRemoteOperationWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", [value description]); + [cluster readAttributeMaxRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock RequirePINforRemoteOperation read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock MaxRFIDCodeLength read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -21903,72 +24807,69 @@ class ReadDoorLockRequirePINforRemoteOperation : public ReadAttribute { } }; -class WriteDoorLockRequirePINforRemoteOperation : public WriteAttribute { +class SubscribeAttributeDoorLockMaxRFIDCodeLength : public SubscribeAttribute { public: - WriteDoorLockRequirePINforRemoteOperation() - : WriteAttribute("require-pinfor-remote-operation") + SubscribeAttributeDoorLockMaxRFIDCodeLength() + : SubscribeAttribute("max-rfidcode-length") { - AddArgument("attr-name", "require-pinfor-remote-operation"); - AddArgument("attr-value", 0, 1, &mValue); - WriteAttribute::AddArguments(); } - ~WriteDoorLockRequirePINforRemoteOperation() {} + ~SubscribeAttributeDoorLockMaxRFIDCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000033) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxRFIDCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeRequirePINforRemoteOperationWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "DoorLock RequirePINforRemoteOperation write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - bool mValue; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Attribute GeneratedCommandList + * Attribute MinRFIDCodeLength */ -class ReadDoorLockGeneratedCommandList : public ReadAttribute { +class ReadDoorLockMinRFIDCodeLength : public ReadAttribute { public: - ReadDoorLockGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadDoorLockMinRFIDCodeLength() + : ReadAttribute("min-rfidcode-length") { } - ~ReadDoorLockGeneratedCommandList() {} + ~ReadDoorLockMinRFIDCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); + [cluster readAttributeMinRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock MinRFIDCodeLength read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -21976,35 +24877,34 @@ class ReadDoorLockGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeDoorLockGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeDoorLockMinRFIDCodeLength : public SubscribeAttribute { public: - SubscribeAttributeDoorLockGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeDoorLockMinRFIDCodeLength() + : SubscribeAttribute("min-rfidcode-length") { } - ~SubscribeAttributeDoorLockGeneratedCommandList() {} + ~SubscribeAttributeDoorLockMinRFIDCodeLength() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMinRFIDCodeLengthWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22016,30 +24916,30 @@ class SubscribeAttributeDoorLockGeneratedCommandList : public SubscribeAttribute }; /* - * Attribute AcceptedCommandList + * Attribute CredentialRulesSupport */ -class ReadDoorLockAcceptedCommandList : public ReadAttribute { +class ReadDoorLockCredentialRulesSupport : public ReadAttribute { public: - ReadDoorLockAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadDoorLockCredentialRulesSupport() + : ReadAttribute("credential-rules-support") { } - ~ReadDoorLockAcceptedCommandList() {} + ~ReadDoorLockCredentialRulesSupport() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); + [cluster readAttributeCredentialRulesSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.CredentialRulesSupport response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock CredentialRulesSupport read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22047,34 +24947,35 @@ class ReadDoorLockAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeDoorLockAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeDoorLockCredentialRulesSupport : public SubscribeAttribute { public: - SubscribeAttributeDoorLockAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeDoorLockCredentialRulesSupport() + : SubscribeAttribute("credential-rules-support") { } - ~SubscribeAttributeDoorLockAcceptedCommandList() {} + ~SubscribeAttributeDoorLockCredentialRulesSupport() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCredentialRulesSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.CredentialRulesSupport response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22086,30 +24987,30 @@ class SubscribeAttributeDoorLockAcceptedCommandList : public SubscribeAttribute }; /* - * Attribute AttributeList + * Attribute EnableLogging */ -class ReadDoorLockAttributeList : public ReadAttribute { +class ReadDoorLockEnableLogging : public ReadAttribute { public: - ReadDoorLockAttributeList() - : ReadAttribute("attribute-list") + ReadDoorLockEnableLogging() + : ReadAttribute("enable-logging") { } - ~ReadDoorLockAttributeList() {} + ~ReadDoorLockEnableLogging() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.AttributeList response %@", [value description]); + [cluster readAttributeEnableLoggingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableLogging response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock EnableLogging read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22117,30 +25018,70 @@ class ReadDoorLockAttributeList : public ReadAttribute { } }; -class SubscribeAttributeDoorLockAttributeList : public SubscribeAttribute { +class WriteDoorLockEnableLogging : public WriteAttribute { public: - SubscribeAttributeDoorLockAttributeList() - : SubscribeAttribute("attribute-list") + WriteDoorLockEnableLogging() + : WriteAttribute("enable-logging") { + AddArgument("attr-name", "enable-logging"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeDoorLockAttributeList() {} + ~WriteDoorLockEnableLogging() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster + writeAttributeEnableLoggingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock EnableLogging write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeDoorLockEnableLogging : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockEnableLogging() + : SubscribeAttribute("enable-logging") + { + } + + ~SubscribeAttributeDoorLockEnableLogging() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeEnableLoggingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.AttributeList response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableLogging response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -22156,30 +25097,30 @@ class SubscribeAttributeDoorLockAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute Language */ -class ReadDoorLockClusterRevision : public ReadAttribute { +class ReadDoorLockLanguage : public ReadAttribute { public: - ReadDoorLockClusterRevision() - : ReadAttribute("cluster-revision") + ReadDoorLockLanguage() + : ReadAttribute("language") { } - ~ReadDoorLockClusterRevision() {} + ~ReadDoorLockLanguage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.ClusterRevision response %@", [value description]); + [cluster readAttributeLanguageWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.Language response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "DoorLock ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock Language read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22187,254 +25128,75 @@ class ReadDoorLockClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeDoorLockClusterRevision : public SubscribeAttribute { +class WriteDoorLockLanguage : public WriteAttribute { public: - SubscribeAttributeDoorLockClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteDoorLockLanguage() + : WriteAttribute("language") { + AddArgument("attr-name", "language"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeDoorLockClusterRevision() {} + ~WriteDoorLockLanguage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DoorLock.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; - return CHIP_NO_ERROR; + [cluster writeAttributeLanguageWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock Language write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ElectricalMeasurement | 0x0B04 | -|------------------------------------------------------------------------------| -| Commands: | | -| * GetProfileInfoCommand | 0x00 | -| * GetMeasurementProfileCommand | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasurementType | 0x0000 | -| * DcVoltage | 0x0100 | -| * DcVoltageMin | 0x0101 | -| * DcVoltageMax | 0x0102 | -| * DcCurrent | 0x0103 | -| * DcCurrentMin | 0x0104 | -| * DcCurrentMax | 0x0105 | -| * DcPower | 0x0106 | -| * DcPowerMin | 0x0107 | -| * DcPowerMax | 0x0108 | -| * DcVoltageMultiplier | 0x0200 | -| * DcVoltageDivisor | 0x0201 | -| * DcCurrentMultiplier | 0x0202 | -| * DcCurrentDivisor | 0x0203 | -| * DcPowerMultiplier | 0x0204 | -| * DcPowerDivisor | 0x0205 | -| * AcFrequency | 0x0300 | -| * AcFrequencyMin | 0x0301 | -| * AcFrequencyMax | 0x0302 | -| * NeutralCurrent | 0x0303 | -| * TotalActivePower | 0x0304 | -| * TotalReactivePower | 0x0305 | -| * TotalApparentPower | 0x0306 | -| * Measured1stHarmonicCurrent | 0x0307 | -| * Measured3rdHarmonicCurrent | 0x0308 | -| * Measured5thHarmonicCurrent | 0x0309 | -| * Measured7thHarmonicCurrent | 0x030A | -| * Measured9thHarmonicCurrent | 0x030B | -| * Measured11thHarmonicCurrent | 0x030C | -| * MeasuredPhase1stHarmonicCurrent | 0x030D | -| * MeasuredPhase3rdHarmonicCurrent | 0x030E | -| * MeasuredPhase5thHarmonicCurrent | 0x030F | -| * MeasuredPhase7thHarmonicCurrent | 0x0310 | -| * MeasuredPhase9thHarmonicCurrent | 0x0311 | -| * MeasuredPhase11thHarmonicCurrent | 0x0312 | -| * AcFrequencyMultiplier | 0x0400 | -| * AcFrequencyDivisor | 0x0401 | -| * PowerMultiplier | 0x0402 | -| * PowerDivisor | 0x0403 | -| * HarmonicCurrentMultiplier | 0x0404 | -| * PhaseHarmonicCurrentMultiplier | 0x0405 | -| * InstantaneousVoltage | 0x0500 | -| * InstantaneousLineCurrent | 0x0501 | -| * InstantaneousActiveCurrent | 0x0502 | -| * InstantaneousReactiveCurrent | 0x0503 | -| * InstantaneousPower | 0x0504 | -| * RmsVoltage | 0x0505 | -| * RmsVoltageMin | 0x0506 | -| * RmsVoltageMax | 0x0507 | -| * RmsCurrent | 0x0508 | -| * RmsCurrentMin | 0x0509 | -| * RmsCurrentMax | 0x050A | -| * ActivePower | 0x050B | -| * ActivePowerMin | 0x050C | -| * ActivePowerMax | 0x050D | -| * ReactivePower | 0x050E | -| * ApparentPower | 0x050F | -| * PowerFactor | 0x0510 | -| * AverageRmsVoltageMeasurementPeriod | 0x0511 | -| * AverageRmsUnderVoltageCounter | 0x0513 | -| * RmsExtremeOverVoltagePeriod | 0x0514 | -| * RmsExtremeUnderVoltagePeriod | 0x0515 | -| * RmsVoltageSagPeriod | 0x0516 | -| * RmsVoltageSwellPeriod | 0x0517 | -| * AcVoltageMultiplier | 0x0600 | -| * AcVoltageDivisor | 0x0601 | -| * AcCurrentMultiplier | 0x0602 | -| * AcCurrentDivisor | 0x0603 | -| * AcPowerMultiplier | 0x0604 | -| * AcPowerDivisor | 0x0605 | -| * OverloadAlarmsMask | 0x0700 | -| * VoltageOverload | 0x0701 | -| * CurrentOverload | 0x0702 | -| * AcOverloadAlarmsMask | 0x0800 | -| * AcVoltageOverload | 0x0801 | -| * AcCurrentOverload | 0x0802 | -| * AcActivePowerOverload | 0x0803 | -| * AcReactivePowerOverload | 0x0804 | -| * AverageRmsOverVoltage | 0x0805 | -| * AverageRmsUnderVoltage | 0x0806 | -| * RmsExtremeOverVoltage | 0x0807 | -| * RmsExtremeUnderVoltage | 0x0808 | -| * RmsVoltageSag | 0x0809 | -| * RmsVoltageSwell | 0x080A | -| * LineCurrentPhaseB | 0x0901 | -| * ActiveCurrentPhaseB | 0x0902 | -| * ReactiveCurrentPhaseB | 0x0903 | -| * RmsVoltagePhaseB | 0x0905 | -| * RmsVoltageMinPhaseB | 0x0906 | -| * RmsVoltageMaxPhaseB | 0x0907 | -| * RmsCurrentPhaseB | 0x0908 | -| * RmsCurrentMinPhaseB | 0x0909 | -| * RmsCurrentMaxPhaseB | 0x090A | -| * ActivePowerPhaseB | 0x090B | -| * ActivePowerMinPhaseB | 0x090C | -| * ActivePowerMaxPhaseB | 0x090D | -| * ReactivePowerPhaseB | 0x090E | -| * ApparentPowerPhaseB | 0x090F | -| * PowerFactorPhaseB | 0x0910 | -| * AverageRmsVoltageMeasurementPeriodPhaseB | 0x0911 | -| * AverageRmsOverVoltageCounterPhaseB | 0x0912 | -| * AverageRmsUnderVoltageCounterPhaseB | 0x0913 | -| * RmsExtremeOverVoltagePeriodPhaseB | 0x0914 | -| * RmsExtremeUnderVoltagePeriodPhaseB | 0x0915 | -| * RmsVoltageSagPeriodPhaseB | 0x0916 | -| * RmsVoltageSwellPeriodPhaseB | 0x0917 | -| * LineCurrentPhaseC | 0x0A01 | -| * ActiveCurrentPhaseC | 0x0A02 | -| * ReactiveCurrentPhaseC | 0x0A03 | -| * RmsVoltagePhaseC | 0x0A05 | -| * RmsVoltageMinPhaseC | 0x0A06 | -| * RmsVoltageMaxPhaseC | 0x0A07 | -| * RmsCurrentPhaseC | 0x0A08 | -| * RmsCurrentMinPhaseC | 0x0A09 | -| * RmsCurrentMaxPhaseC | 0x0A0A | -| * ActivePowerPhaseC | 0x0A0B | -| * ActivePowerMinPhaseC | 0x0A0C | -| * ActivePowerMaxPhaseC | 0x0A0D | -| * ReactivePowerPhaseC | 0x0A0E | -| * ApparentPowerPhaseC | 0x0A0F | -| * PowerFactorPhaseC | 0x0A10 | -| * AverageRmsVoltageMeasurementPeriodPhaseC | 0x0A11 | -| * AverageRmsOverVoltageCounterPhaseC | 0x0A12 | -| * AverageRmsUnderVoltageCounterPhaseC | 0x0A13 | -| * RmsExtremeOverVoltagePeriodPhaseC | 0x0A14 | -| * RmsExtremeUnderVoltagePeriodPhaseC | 0x0A15 | -| * RmsVoltageSagPeriodPhaseC | 0x0A16 | -| * RmsVoltageSwellPeriodPhaseC | 0x0A17 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasurementType - */ -class ReadElectricalMeasurementMeasurementType : public ReadAttribute { -public: - ReadElectricalMeasurementMeasurementType() - : ReadAttribute("measurement-type") - { - } - - ~ReadElectricalMeasurementMeasurementType() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMeasurementTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement MeasurementType read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } +private: + chip::ByteSpan mValue; }; -class SubscribeAttributeElectricalMeasurementMeasurementType : public SubscribeAttribute { +class SubscribeAttributeDoorLockLanguage : public SubscribeAttribute { public: - SubscribeAttributeElectricalMeasurementMeasurementType() - : SubscribeAttribute("measurement-type") + SubscribeAttributeDoorLockLanguage() + : SubscribeAttribute("language") { } - ~SubscribeAttributeElectricalMeasurementMeasurementType() {} + ~SubscribeAttributeDoorLockLanguage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMeasurementTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLanguageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.Language response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22446,32 +25208,30 @@ class SubscribeAttributeElectricalMeasurementMeasurementType : public SubscribeA }; /* - * Attribute TotalActivePower + * Attribute LEDSettings */ -class ReadElectricalMeasurementTotalActivePower : public ReadAttribute { +class ReadDoorLockLEDSettings : public ReadAttribute { public: - ReadElectricalMeasurementTotalActivePower() - : ReadAttribute("total-active-power") + ReadDoorLockLEDSettings() + : ReadAttribute("ledsettings") { } - ~ReadElectricalMeasurementTotalActivePower() {} + ~ReadDoorLockLEDSettings() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000304) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTotalActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.TotalActivePower response %@", [value description]); + [cluster readAttributeLEDSettingsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LEDSettings response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement TotalActivePower read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock LEDSettings read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22479,37 +25239,73 @@ class ReadElectricalMeasurementTotalActivePower : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementTotalActivePower : public SubscribeAttribute { +class WriteDoorLockLEDSettings : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementTotalActivePower() - : SubscribeAttribute("total-active-power") + WriteDoorLockLEDSettings() + : WriteAttribute("ledsettings") { + AddArgument("attr-name", "ledsettings"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementTotalActivePower() {} + ~WriteDoorLockLEDSettings() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000304) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeLEDSettingsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock LEDSettings write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeDoorLockLEDSettings : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockLEDSettings() + : SubscribeAttribute("ledsettings") + { + } + + ~SubscribeAttributeDoorLockLEDSettings() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000022) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTotalActivePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.TotalActivePower response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLEDSettingsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LEDSettings response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22521,32 +25317,30 @@ class SubscribeAttributeElectricalMeasurementTotalActivePower : public Subscribe }; /* - * Attribute RmsVoltage + * Attribute AutoRelockTime */ -class ReadElectricalMeasurementRmsVoltage : public ReadAttribute { +class ReadDoorLockAutoRelockTime : public ReadAttribute { public: - ReadElectricalMeasurementRmsVoltage() - : ReadAttribute("rms-voltage") + ReadDoorLockAutoRelockTime() + : ReadAttribute("auto-relock-time") { } - ~ReadElectricalMeasurementRmsVoltage() {} + ~ReadDoorLockAutoRelockTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000505) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRmsVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); + [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement RmsVoltage read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock AutoRelockTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22554,36 +25348,74 @@ class ReadElectricalMeasurementRmsVoltage : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementRmsVoltage : public SubscribeAttribute { +class WriteDoorLockAutoRelockTime : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementRmsVoltage() - : SubscribeAttribute("rms-voltage") + WriteDoorLockAutoRelockTime() + : WriteAttribute("auto-relock-time") + { + AddArgument("attr-name", "auto-relock-time"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteDoorLockAutoRelockTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000023) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeAutoRelockTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "DoorLock AutoRelockTime write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } - ~SubscribeAttributeElectricalMeasurementRmsVoltage() {} +private: + uint32_t mValue; +}; + +class SubscribeAttributeDoorLockAutoRelockTime : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockAutoRelockTime() + : SubscribeAttribute("auto-relock-time") + { + } + + ~SubscribeAttributeDoorLockAutoRelockTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000505) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRmsVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAutoRelockTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22595,32 +25427,30 @@ class SubscribeAttributeElectricalMeasurementRmsVoltage : public SubscribeAttrib }; /* - * Attribute RmsVoltageMin + * Attribute SoundVolume */ -class ReadElectricalMeasurementRmsVoltageMin : public ReadAttribute { +class ReadDoorLockSoundVolume : public ReadAttribute { public: - ReadElectricalMeasurementRmsVoltageMin() - : ReadAttribute("rms-voltage-min") + ReadDoorLockSoundVolume() + : ReadAttribute("sound-volume") { } - ~ReadElectricalMeasurementRmsVoltageMin() {} + ~ReadDoorLockSoundVolume() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000506) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRmsVoltageMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); + [cluster readAttributeSoundVolumeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.SoundVolume response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMin read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock SoundVolume read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22628,37 +25458,73 @@ class ReadElectricalMeasurementRmsVoltageMin : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementRmsVoltageMin : public SubscribeAttribute { +class WriteDoorLockSoundVolume : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementRmsVoltageMin() - : SubscribeAttribute("rms-voltage-min") + WriteDoorLockSoundVolume() + : WriteAttribute("sound-volume") { + AddArgument("attr-name", "sound-volume"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementRmsVoltageMin() {} + ~WriteDoorLockSoundVolume() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000506) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSoundVolumeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock SoundVolume write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeDoorLockSoundVolume : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockSoundVolume() + : SubscribeAttribute("sound-volume") + { + } + + ~SubscribeAttributeDoorLockSoundVolume() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000024) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeRmsVoltageMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSoundVolumeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.SoundVolume response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22670,32 +25536,30 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMin : public SubscribeAtt }; /* - * Attribute RmsVoltageMax + * Attribute OperatingMode */ -class ReadElectricalMeasurementRmsVoltageMax : public ReadAttribute { +class ReadDoorLockOperatingMode : public ReadAttribute { public: - ReadElectricalMeasurementRmsVoltageMax() - : ReadAttribute("rms-voltage-max") + ReadDoorLockOperatingMode() + : ReadAttribute("operating-mode") { } - ~ReadElectricalMeasurementRmsVoltageMax() {} + ~ReadDoorLockOperatingMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000507) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRmsVoltageMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); + [cluster readAttributeOperatingModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.OperatingMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMax read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock OperatingMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22703,37 +25567,74 @@ class ReadElectricalMeasurementRmsVoltageMax : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementRmsVoltageMax : public SubscribeAttribute { +class WriteDoorLockOperatingMode : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementRmsVoltageMax() - : SubscribeAttribute("rms-voltage-max") + WriteDoorLockOperatingMode() + : WriteAttribute("operating-mode") { - } + AddArgument("attr-name", "operating-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } - ~SubscribeAttributeElectricalMeasurementRmsVoltageMax() {} + ~WriteDoorLockOperatingMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000507) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributeOperatingModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock OperatingMode write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeDoorLockOperatingMode : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockOperatingMode() + : SubscribeAttribute("operating-mode") + { + } + + ~SubscribeAttributeDoorLockOperatingMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000025) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeRmsVoltageMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOperatingModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.OperatingMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22745,69 +25646,67 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMax : public SubscribeAtt }; /* - * Attribute RmsCurrent + * Attribute SupportedOperatingModes */ -class ReadElectricalMeasurementRmsCurrent : public ReadAttribute { +class ReadDoorLockSupportedOperatingModes : public ReadAttribute { public: - ReadElectricalMeasurementRmsCurrent() - : ReadAttribute("rms-current") + ReadDoorLockSupportedOperatingModes() + : ReadAttribute("supported-operating-modes") { } - ~ReadElectricalMeasurementRmsCurrent() {} + ~ReadDoorLockSupportedOperatingModes() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000508) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRmsCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeSupportedOperatingModesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.SupportedOperatingModes response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement RmsCurrent read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock SupportedOperatingModes read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeElectricalMeasurementRmsCurrent : public SubscribeAttribute { +class SubscribeAttributeDoorLockSupportedOperatingModes : public SubscribeAttribute { public: - SubscribeAttributeElectricalMeasurementRmsCurrent() - : SubscribeAttribute("rms-current") + SubscribeAttributeDoorLockSupportedOperatingModes() + : SubscribeAttribute("supported-operating-modes") { } - ~SubscribeAttributeElectricalMeasurementRmsCurrent() {} + ~SubscribeAttributeDoorLockSupportedOperatingModes() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000508) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRmsCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSupportedOperatingModesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.SupportedOperatingModes response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22819,32 +25718,31 @@ class SubscribeAttributeElectricalMeasurementRmsCurrent : public SubscribeAttrib }; /* - * Attribute RmsCurrentMin + * Attribute DefaultConfigurationRegister */ -class ReadElectricalMeasurementRmsCurrentMin : public ReadAttribute { +class ReadDoorLockDefaultConfigurationRegister : public ReadAttribute { public: - ReadElectricalMeasurementRmsCurrentMin() - : ReadAttribute("rms-current-min") + ReadDoorLockDefaultConfigurationRegister() + : ReadAttribute("default-configuration-register") { } - ~ReadElectricalMeasurementRmsCurrentMin() {} + ~ReadDoorLockDefaultConfigurationRegister() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000509) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRmsCurrentMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); + [cluster readAttributeDefaultConfigurationRegisterWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DefaultConfigurationRegister response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMin read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock DefaultConfigurationRegister read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22852,37 +25750,36 @@ class ReadElectricalMeasurementRmsCurrentMin : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementRmsCurrentMin : public SubscribeAttribute { +class SubscribeAttributeDoorLockDefaultConfigurationRegister : public SubscribeAttribute { public: - SubscribeAttributeElectricalMeasurementRmsCurrentMin() - : SubscribeAttribute("rms-current-min") + SubscribeAttributeDoorLockDefaultConfigurationRegister() + : SubscribeAttribute("default-configuration-register") { } - ~SubscribeAttributeElectricalMeasurementRmsCurrentMin() {} + ~SubscribeAttributeDoorLockDefaultConfigurationRegister() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000509) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeRmsCurrentMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeDefaultConfigurationRegisterWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.DefaultConfigurationRegister response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -22894,32 +25791,30 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMin : public SubscribeAtt }; /* - * Attribute RmsCurrentMax + * Attribute EnableLocalProgramming */ -class ReadElectricalMeasurementRmsCurrentMax : public ReadAttribute { +class ReadDoorLockEnableLocalProgramming : public ReadAttribute { public: - ReadElectricalMeasurementRmsCurrentMax() - : ReadAttribute("rms-current-max") + ReadDoorLockEnableLocalProgramming() + : ReadAttribute("enable-local-programming") { } - ~ReadElectricalMeasurementRmsCurrentMax() {} + ~ReadDoorLockEnableLocalProgramming() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRmsCurrentMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); + [cluster readAttributeEnableLocalProgrammingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableLocalProgramming response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMax read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock EnableLocalProgramming read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -22927,111 +25822,75 @@ class ReadElectricalMeasurementRmsCurrentMax : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementRmsCurrentMax : public SubscribeAttribute { +class WriteDoorLockEnableLocalProgramming : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementRmsCurrentMax() - : SubscribeAttribute("rms-current-max") + WriteDoorLockEnableLocalProgramming() + : WriteAttribute("enable-local-programming") { + AddArgument("attr-name", "enable-local-programming"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementRmsCurrentMax() {} + ~WriteDoorLockEnableLocalProgramming() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeRmsCurrentMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeEnableLocalProgrammingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock EnableLocalProgramming write Error: %s", + chip::ErrorStr(chipError)); } + SetCommandExitStatus(chipError); }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } -}; - -/* - * Attribute ActivePower - */ -class ReadElectricalMeasurementActivePower : public ReadAttribute { -public: - ReadElectricalMeasurementActivePower() - : ReadAttribute("active-power") - { + return chipError; } - ~ReadElectricalMeasurementActivePower() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050B) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement ActivePower read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } +private: + bool mValue; }; -class SubscribeAttributeElectricalMeasurementActivePower : public SubscribeAttribute { +class SubscribeAttributeDoorLockEnableLocalProgramming : public SubscribeAttribute { public: - SubscribeAttributeElectricalMeasurementActivePower() - : SubscribeAttribute("active-power") + SubscribeAttributeDoorLockEnableLocalProgramming() + : SubscribeAttribute("enable-local-programming") { } - ~SubscribeAttributeElectricalMeasurementActivePower() {} + ~SubscribeAttributeDoorLockEnableLocalProgramming() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeActivePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeEnableLocalProgrammingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableLocalProgramming response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23043,32 +25902,30 @@ class SubscribeAttributeElectricalMeasurementActivePower : public SubscribeAttri }; /* - * Attribute ActivePowerMin + * Attribute EnableOneTouchLocking */ -class ReadElectricalMeasurementActivePowerMin : public ReadAttribute { +class ReadDoorLockEnableOneTouchLocking : public ReadAttribute { public: - ReadElectricalMeasurementActivePowerMin() - : ReadAttribute("active-power-min") + ReadDoorLockEnableOneTouchLocking() + : ReadAttribute("enable-one-touch-locking") { } - ~ReadElectricalMeasurementActivePowerMin() {} + ~ReadDoorLockEnableOneTouchLocking() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActivePowerMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); + [cluster readAttributeEnableOneTouchLockingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMin read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock EnableOneTouchLocking read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23076,37 +25933,75 @@ class ReadElectricalMeasurementActivePowerMin : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementActivePowerMin : public SubscribeAttribute { +class WriteDoorLockEnableOneTouchLocking : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementActivePowerMin() - : SubscribeAttribute("active-power-min") + WriteDoorLockEnableOneTouchLocking() + : WriteAttribute("enable-one-touch-locking") { + AddArgument("attr-name", "enable-one-touch-locking"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementActivePowerMin() {} + ~WriteDoorLockEnableOneTouchLocking() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeEnableOneTouchLockingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock EnableOneTouchLocking write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeDoorLockEnableOneTouchLocking : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockEnableOneTouchLocking() + : SubscribeAttribute("enable-one-touch-locking") + { + } + + ~SubscribeAttributeDoorLockEnableOneTouchLocking() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000029) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeActivePowerMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeEnableOneTouchLockingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23118,32 +26013,30 @@ class SubscribeAttributeElectricalMeasurementActivePowerMin : public SubscribeAt }; /* - * Attribute ActivePowerMax + * Attribute EnableInsideStatusLED */ -class ReadElectricalMeasurementActivePowerMax : public ReadAttribute { +class ReadDoorLockEnableInsideStatusLED : public ReadAttribute { public: - ReadElectricalMeasurementActivePowerMax() - : ReadAttribute("active-power-max") + ReadDoorLockEnableInsideStatusLED() + : ReadAttribute("enable-inside-status-led") { } - ~ReadElectricalMeasurementActivePowerMax() {} + ~ReadDoorLockEnableInsideStatusLED() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000002A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActivePowerMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); + [cluster readAttributeEnableInsideStatusLEDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableInsideStatusLED response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMax read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock EnableInsideStatusLED read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23151,37 +26044,75 @@ class ReadElectricalMeasurementActivePowerMax : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementActivePowerMax : public SubscribeAttribute { +class WriteDoorLockEnableInsideStatusLED : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementActivePowerMax() - : SubscribeAttribute("active-power-max") + WriteDoorLockEnableInsideStatusLED() + : WriteAttribute("enable-inside-status-led") { + AddArgument("attr-name", "enable-inside-status-led"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementActivePowerMax() {} + ~WriteDoorLockEnableInsideStatusLED() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x0000002A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeEnableInsideStatusLEDWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock EnableInsideStatusLED write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeDoorLockEnableInsideStatusLED : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockEnableInsideStatusLED() + : SubscribeAttribute("enable-inside-status-led") + { + } + + ~SubscribeAttributeDoorLockEnableInsideStatusLED() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000002A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeActivePowerMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeEnableInsideStatusLEDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnableInsideStatusLED response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23193,70 +26124,107 @@ class SubscribeAttributeElectricalMeasurementActivePowerMax : public SubscribeAt }; /* - * Attribute GeneratedCommandList + * Attribute EnablePrivacyModeButton */ -class ReadElectricalMeasurementGeneratedCommandList : public ReadAttribute { +class ReadDoorLockEnablePrivacyModeButton : public ReadAttribute { public: - ReadElectricalMeasurementGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadDoorLockEnablePrivacyModeButton() + : ReadAttribute("enable-privacy-mode-button") { } - ~ReadElectricalMeasurementGeneratedCommandList() {} + ~ReadDoorLockEnablePrivacyModeButton() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000002B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeEnablePrivacyModeButtonWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnablePrivacyModeButton response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock EnablePrivacyModeButton read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeElectricalMeasurementGeneratedCommandList : public SubscribeAttribute { +class WriteDoorLockEnablePrivacyModeButton : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteDoorLockEnablePrivacyModeButton() + : WriteAttribute("enable-privacy-mode-button") { + AddArgument("attr-name", "enable-privacy-mode-button"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementGeneratedCommandList() {} + ~WriteDoorLockEnablePrivacyModeButton() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x0000002B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeEnablePrivacyModeButtonWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock EnablePrivacyModeButton write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeDoorLockEnablePrivacyModeButton : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockEnablePrivacyModeButton() + : SubscribeAttribute("enable-privacy-mode-button") + { + } + + ~SubscribeAttributeDoorLockEnablePrivacyModeButton() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000002B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeEnablePrivacyModeButtonWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.EnablePrivacyModeButton response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23268,65 +26236,103 @@ class SubscribeAttributeElectricalMeasurementGeneratedCommandList : public Subsc }; /* - * Attribute AcceptedCommandList + * Attribute LocalProgrammingFeatures */ -class ReadElectricalMeasurementAcceptedCommandList : public ReadAttribute { +class ReadDoorLockLocalProgrammingFeatures : public ReadAttribute { public: - ReadElectricalMeasurementAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadDoorLockLocalProgrammingFeatures() + : ReadAttribute("local-programming-features") { } - ~ReadElectricalMeasurementAcceptedCommandList() {} + ~ReadDoorLockLocalProgrammingFeatures() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000002C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeLocalProgrammingFeaturesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LocalProgrammingFeatures response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock LocalProgrammingFeatures read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeElectricalMeasurementAcceptedCommandList : public SubscribeAttribute { +class WriteDoorLockLocalProgrammingFeatures : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteDoorLockLocalProgrammingFeatures() + : WriteAttribute("local-programming-features") { + AddArgument("attr-name", "local-programming-features"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementAcceptedCommandList() {} + ~WriteDoorLockLocalProgrammingFeatures() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x0000002C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeLocalProgrammingFeaturesWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock LocalProgrammingFeatures write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeDoorLockLocalProgrammingFeatures : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockLocalProgrammingFeatures() + : SubscribeAttribute("local-programming-features") + { + } + + ~SubscribeAttributeDoorLockLocalProgrammingFeatures() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000002C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster + subscribeAttributeLocalProgrammingFeaturesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.LocalProgrammingFeatures response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -23343,32 +26349,30 @@ class SubscribeAttributeElectricalMeasurementAcceptedCommandList : public Subscr }; /* - * Attribute AttributeList + * Attribute WrongCodeEntryLimit */ -class ReadElectricalMeasurementAttributeList : public ReadAttribute { +class ReadDoorLockWrongCodeEntryLimit : public ReadAttribute { public: - ReadElectricalMeasurementAttributeList() - : ReadAttribute("attribute-list") + ReadDoorLockWrongCodeEntryLimit() + : ReadAttribute("wrong-code-entry-limit") { } - ~ReadElectricalMeasurementAttributeList() {} + ~ReadDoorLockWrongCodeEntryLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); + [cluster readAttributeWrongCodeEntryLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock WrongCodeEntryLimit read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23376,37 +26380,74 @@ class ReadElectricalMeasurementAttributeList : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementAttributeList : public SubscribeAttribute { +class WriteDoorLockWrongCodeEntryLimit : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementAttributeList() - : SubscribeAttribute("attribute-list") + WriteDoorLockWrongCodeEntryLimit() + : WriteAttribute("wrong-code-entry-limit") { + AddArgument("attr-name", "wrong-code-entry-limit"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementAttributeList() {} + ~WriteDoorLockWrongCodeEntryLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeWrongCodeEntryLimitWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock WrongCodeEntryLimit write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeDoorLockWrongCodeEntryLimit : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockWrongCodeEntryLimit() + : SubscribeAttribute("wrong-code-entry-limit") + { + } + + ~SubscribeAttributeDoorLockWrongCodeEntryLimit() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000030) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeWrongCodeEntryLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23418,32 +26459,31 @@ class SubscribeAttributeElectricalMeasurementAttributeList : public SubscribeAtt }; /* - * Attribute ClusterRevision + * Attribute UserCodeTemporaryDisableTime */ -class ReadElectricalMeasurementClusterRevision : public ReadAttribute { +class ReadDoorLockUserCodeTemporaryDisableTime : public ReadAttribute { public: - ReadElectricalMeasurementClusterRevision() - : ReadAttribute("cluster-revision") + ReadDoorLockUserCodeTemporaryDisableTime() + : ReadAttribute("user-code-temporary-disable-time") { } - ~ReadElectricalMeasurementClusterRevision() {} + ~ReadDoorLockUserCodeTemporaryDisableTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); + [cluster readAttributeUserCodeTemporaryDisableTimeWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ElectricalMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock UserCodeTemporaryDisableTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23451,37 +26491,77 @@ class ReadElectricalMeasurementClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeAttribute { +class WriteDoorLockUserCodeTemporaryDisableTime : public WriteAttribute { public: - SubscribeAttributeElectricalMeasurementClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteDoorLockUserCodeTemporaryDisableTime() + : WriteAttribute("user-code-temporary-disable-time") { + AddArgument("attr-name", "user-code-temporary-disable-time"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeElectricalMeasurementClusterRevision() {} + ~WriteDoorLockUserCodeTemporaryDisableTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeUserCodeTemporaryDisableTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "DoorLock UserCodeTemporaryDisableTime write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeDoorLockUserCodeTemporaryDisableTime : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockUserCodeTemporaryDisableTime() + : SubscribeAttribute("user-code-temporary-disable-time") + { + } + + ~SubscribeAttributeDoorLockUserCodeTemporaryDisableTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000031) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeUserCodeTemporaryDisableTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23492,139 +26572,106 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA } }; -/*----------------------------------------------------------------------------*\ -| Cluster EthernetNetworkDiagnostics | 0x0037 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ResetCounts | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * PHYRate | 0x0000 | -| * FullDuplex | 0x0001 | -| * PacketRxCount | 0x0002 | -| * PacketTxCount | 0x0003 | -| * TxErrCount | 0x0004 | -| * CollisionCount | 0x0005 | -| * OverrunCount | 0x0006 | -| * CarrierDetect | 0x0007 | -| * TimeSinceReset | 0x0008 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command ResetCounts + * Attribute SendPINOverTheAir */ -class EthernetNetworkDiagnosticsResetCounts : public ClusterCommand { +class ReadDoorLockSendPINOverTheAir : public ReadAttribute { public: - EthernetNetworkDiagnosticsResetCounts() - : ClusterCommand("reset-counts") + ReadDoorLockSendPINOverTheAir() + : ReadAttribute("send-pinover-the-air") { - ClusterCommand::AddArguments(); } + ~ReadDoorLockSendPINOverTheAir() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPEthernetNetworkDiagnosticsClusterResetCountsParams 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 resetCountsWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSendPINOverTheAirWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.SendPINOverTheAir response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "DoorLock SendPINOverTheAir read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Attribute PHYRate - */ -class ReadEthernetNetworkDiagnosticsPHYRate : public ReadAttribute { +class WriteDoorLockSendPINOverTheAir : public WriteAttribute { public: - ReadEthernetNetworkDiagnosticsPHYRate() - : ReadAttribute("phyrate") + WriteDoorLockSendPINOverTheAir() + : WriteAttribute("send-pinover-the-air") { + AddArgument("attr-name", "send-pinover-the-air"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~ReadEthernetNetworkDiagnosticsPHYRate() {} + ~WriteDoorLockSendPINOverTheAir() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics PHYRate read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeSendPINOverTheAirWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock SendPINOverTheAir write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } + +private: + bool mValue; }; -class SubscribeAttributeEthernetNetworkDiagnosticsPHYRate : public SubscribeAttribute { +class SubscribeAttributeDoorLockSendPINOverTheAir : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsPHYRate() - : SubscribeAttribute("phyrate") + SubscribeAttributeDoorLockSendPINOverTheAir() + : SubscribeAttribute("send-pinover-the-air") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsPHYRate() {} + ~SubscribeAttributeDoorLockSendPINOverTheAir() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePHYRateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSendPINOverTheAirWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.SendPINOverTheAir response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23636,32 +26683,31 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPHYRate : public SubscribeAttr }; /* - * Attribute FullDuplex + * Attribute RequirePINforRemoteOperation */ -class ReadEthernetNetworkDiagnosticsFullDuplex : public ReadAttribute { +class ReadDoorLockRequirePINforRemoteOperation : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsFullDuplex() - : ReadAttribute("full-duplex") + ReadDoorLockRequirePINforRemoteOperation() + : ReadAttribute("require-pinfor-remote-operation") { } - ~ReadEthernetNetworkDiagnosticsFullDuplex() {} + ~ReadDoorLockRequirePINforRemoteOperation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000033) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); + [cluster readAttributeRequirePINforRemoteOperationWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics FullDuplex read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock RequirePINforRemoteOperation read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23669,111 +26715,77 @@ class ReadEthernetNetworkDiagnosticsFullDuplex : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex : public SubscribeAttribute { +class WriteDoorLockRequirePINforRemoteOperation : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex() - : SubscribeAttribute("full-duplex") + WriteDoorLockRequirePINforRemoteOperation() + : WriteAttribute("require-pinfor-remote-operation") { + AddArgument("attr-name", "require-pinfor-remote-operation"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex() {} + ~WriteDoorLockRequirePINforRemoteOperation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000033) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFullDuplexWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } -}; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; -/* - * Attribute PacketRxCount - */ -class ReadEthernetNetworkDiagnosticsPacketRxCount : public ReadAttribute { -public: - ReadEthernetNetworkDiagnosticsPacketRxCount() - : ReadAttribute("packet-rx-count") - { + [cluster writeAttributeRequirePINforRemoteOperationWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "DoorLock RequirePINforRemoteOperation write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } - ~ReadEthernetNetworkDiagnosticsPacketRxCount() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics PacketRxCount read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } +private: + bool mValue; }; -class SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount : public SubscribeAttribute { +class SubscribeAttributeDoorLockRequirePINforRemoteOperation : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount() - : SubscribeAttribute("packet-rx-count") + SubscribeAttributeDoorLockRequirePINforRemoteOperation() + : SubscribeAttribute("require-pinfor-remote-operation") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount() {} + ~SubscribeAttributeDoorLockRequirePINforRemoteOperation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000033) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePacketRxCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRequirePINforRemoteOperationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23785,32 +26797,30 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount : public Subscri }; /* - * Attribute PacketTxCount + * Attribute ExpiringUserTimeout */ -class ReadEthernetNetworkDiagnosticsPacketTxCount : public ReadAttribute { +class ReadDoorLockExpiringUserTimeout : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsPacketTxCount() - : ReadAttribute("packet-tx-count") + ReadDoorLockExpiringUserTimeout() + : ReadAttribute("expiring-user-timeout") { } - ~ReadEthernetNetworkDiagnosticsPacketTxCount() {} + ~ReadDoorLockExpiringUserTimeout() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000035) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", [value description]); + [cluster readAttributeExpiringUserTimeoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.ExpiringUserTimeout response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics PacketTxCount read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock ExpiringUserTimeout read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23818,37 +26828,74 @@ class ReadEthernetNetworkDiagnosticsPacketTxCount : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount : public SubscribeAttribute { +class WriteDoorLockExpiringUserTimeout : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount() - : SubscribeAttribute("packet-tx-count") + WriteDoorLockExpiringUserTimeout() + : WriteAttribute("expiring-user-timeout") { + AddArgument("attr-name", "expiring-user-timeout"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount() {} + ~WriteDoorLockExpiringUserTimeout() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000035) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeExpiringUserTimeoutWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock ExpiringUserTimeout write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockExpiringUserTimeout : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockExpiringUserTimeout() + : SubscribeAttribute("expiring-user-timeout") + { + } + + ~SubscribeAttributeDoorLockExpiringUserTimeout() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000035) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePacketTxCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeExpiringUserTimeoutWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.ExpiringUserTimeout response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23860,32 +26907,30 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount : public Subscri }; /* - * Attribute TxErrCount + * Attribute AlarmMask */ -class ReadEthernetNetworkDiagnosticsTxErrCount : public ReadAttribute { +class ReadDoorLockAlarmMask : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsTxErrCount() - : ReadAttribute("tx-err-count") + ReadDoorLockAlarmMask() + : ReadAttribute("alarm-mask") { } - ~ReadEthernetNetworkDiagnosticsTxErrCount() {} + ~ReadDoorLockAlarmMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); + [cluster readAttributeAlarmMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.AlarmMask response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics TxErrCount read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock AlarmMask read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -23893,36 +26938,73 @@ class ReadEthernetNetworkDiagnosticsTxErrCount : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount : public SubscribeAttribute { +class WriteDoorLockAlarmMask : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount() - : SubscribeAttribute("tx-err-count") + WriteDoorLockAlarmMask() + : WriteAttribute("alarm-mask") { + AddArgument("attr-name", "alarm-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount() {} + ~WriteDoorLockAlarmMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeAlarmMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock AlarmMask write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockAlarmMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockAlarmMask() + : SubscribeAttribute("alarm-mask") + { + } + + ~SubscribeAttributeDoorLockAlarmMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000040) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTxErrCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAlarmMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.AlarmMask response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -23934,70 +27016,108 @@ class SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount : public SubscribeA }; /* - * Attribute CollisionCount + * Attribute KeypadOperationEventMask */ -class ReadEthernetNetworkDiagnosticsCollisionCount : public ReadAttribute { +class ReadDoorLockKeypadOperationEventMask : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsCollisionCount() - : ReadAttribute("collision-count") + ReadDoorLockKeypadOperationEventMask() + : ReadAttribute("keypad-operation-event-mask") { } - ~ReadEthernetNetworkDiagnosticsCollisionCount() {} + ~ReadDoorLockKeypadOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeKeypadOperationEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.KeypadOperationEventMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics CollisionCount read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock KeypadOperationEventMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount : public SubscribeAttribute { +class WriteDoorLockKeypadOperationEventMask : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount() - : SubscribeAttribute("collision-count") + WriteDoorLockKeypadOperationEventMask() + : WriteAttribute("keypad-operation-event-mask") { + AddArgument("attr-name", "keypad-operation-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount() {} + ~WriteDoorLockKeypadOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeKeypadOperationEventMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock KeypadOperationEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockKeypadOperationEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockKeypadOperationEventMask() + : SubscribeAttribute("keypad-operation-event-mask") + { + } + + ~SubscribeAttributeDoorLockKeypadOperationEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000041) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCollisionCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeKeypadOperationEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.KeypadOperationEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24009,70 +27129,108 @@ class SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount : public Subscr }; /* - * Attribute OverrunCount + * Attribute RemoteOperationEventMask */ -class ReadEthernetNetworkDiagnosticsOverrunCount : public ReadAttribute { +class ReadDoorLockRemoteOperationEventMask : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsOverrunCount() - : ReadAttribute("overrun-count") + ReadDoorLockRemoteOperationEventMask() + : ReadAttribute("remote-operation-event-mask") { } - ~ReadEthernetNetworkDiagnosticsOverrunCount() {} + ~ReadDoorLockRemoteOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeRemoteOperationEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RemoteOperationEventMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics OverrunCount read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock RemoteOperationEventMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount : public SubscribeAttribute { +class WriteDoorLockRemoteOperationEventMask : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount() - : SubscribeAttribute("overrun-count") + WriteDoorLockRemoteOperationEventMask() + : WriteAttribute("remote-operation-event-mask") { + AddArgument("attr-name", "remote-operation-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount() {} + ~WriteDoorLockRemoteOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeRemoteOperationEventMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock RemoteOperationEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockRemoteOperationEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockRemoteOperationEventMask() + : SubscribeAttribute("remote-operation-event-mask") + { + } + + ~SubscribeAttributeDoorLockRemoteOperationEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000042) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeOverrunCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeRemoteOperationEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RemoteOperationEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24084,70 +27242,108 @@ class SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount : public Subscrib }; /* - * Attribute CarrierDetect + * Attribute ManualOperationEventMask */ -class ReadEthernetNetworkDiagnosticsCarrierDetect : public ReadAttribute { +class ReadDoorLockManualOperationEventMask : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsCarrierDetect() - : ReadAttribute("carrier-detect") + ReadDoorLockManualOperationEventMask() + : ReadAttribute("manual-operation-event-mask") { } - ~ReadEthernetNetworkDiagnosticsCarrierDetect() {} + ~ReadDoorLockManualOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000043) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeManualOperationEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.ManualOperationEventMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics CarrierDetect read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock ManualOperationEventMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect : public SubscribeAttribute { +class WriteDoorLockManualOperationEventMask : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect() - : SubscribeAttribute("carrier-detect") + WriteDoorLockManualOperationEventMask() + : WriteAttribute("manual-operation-event-mask") { + AddArgument("attr-name", "manual-operation-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect() {} + ~WriteDoorLockManualOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000043) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeManualOperationEventMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock ManualOperationEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockManualOperationEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockManualOperationEventMask() + : SubscribeAttribute("manual-operation-event-mask") + { + } + + ~SubscribeAttributeDoorLockManualOperationEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000043) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCarrierDetectWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeManualOperationEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.ManualOperationEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24159,32 +27355,30 @@ class SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect : public Subscri }; /* - * Attribute TimeSinceReset + * Attribute RFIDOperationEventMask */ -class ReadEthernetNetworkDiagnosticsTimeSinceReset : public ReadAttribute { +class ReadDoorLockRFIDOperationEventMask : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsTimeSinceReset() - : ReadAttribute("time-since-reset") + ReadDoorLockRFIDOperationEventMask() + : ReadAttribute("rfidoperation-event-mask") { } - ~ReadEthernetNetworkDiagnosticsTimeSinceReset() {} + ~ReadDoorLockRFIDOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000044) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", [value description]); + [cluster readAttributeRFIDOperationEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RFIDOperationEventMask response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics TimeSinceReset read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock RFIDOperationEventMask read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24192,37 +27386,416 @@ class ReadEthernetNetworkDiagnosticsTimeSinceReset : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset : public SubscribeAttribute { +class WriteDoorLockRFIDOperationEventMask : public WriteAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset() - : SubscribeAttribute("time-since-reset") + WriteDoorLockRFIDOperationEventMask() + : WriteAttribute("rfidoperation-event-mask") { + AddArgument("attr-name", "rfidoperation-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset() {} + ~WriteDoorLockRFIDOperationEventMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000044) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeRFIDOperationEventMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock RFIDOperationEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockRFIDOperationEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockRFIDOperationEventMask() + : SubscribeAttribute("rfidoperation-event-mask") + { + } + + ~SubscribeAttributeDoorLockRFIDOperationEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000044) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTimeSinceResetWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + [cluster subscribeAttributeRFIDOperationEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RFIDOperationEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute KeypadProgrammingEventMask + */ +class ReadDoorLockKeypadProgrammingEventMask : public ReadAttribute { +public: + ReadDoorLockKeypadProgrammingEventMask() + : ReadAttribute("keypad-programming-event-mask") + { + } + + ~ReadDoorLockKeypadProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000045) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeKeypadProgrammingEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.KeypadProgrammingEventMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "DoorLock KeypadProgrammingEventMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteDoorLockKeypadProgrammingEventMask : public WriteAttribute { +public: + WriteDoorLockKeypadProgrammingEventMask() + : WriteAttribute("keypad-programming-event-mask") + { + AddArgument("attr-name", "keypad-programming-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteDoorLockKeypadProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000045) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeKeypadProgrammingEventMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock KeypadProgrammingEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockKeypadProgrammingEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockKeypadProgrammingEventMask() + : SubscribeAttribute("keypad-programming-event-mask") + { + } + + ~SubscribeAttributeDoorLockKeypadProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000045) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeKeypadProgrammingEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.KeypadProgrammingEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute RemoteProgrammingEventMask + */ +class ReadDoorLockRemoteProgrammingEventMask : public ReadAttribute { +public: + ReadDoorLockRemoteProgrammingEventMask() + : ReadAttribute("remote-programming-event-mask") + { + } + + ~ReadDoorLockRemoteProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000046) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeRemoteProgrammingEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RemoteProgrammingEventMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "DoorLock RemoteProgrammingEventMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteDoorLockRemoteProgrammingEventMask : public WriteAttribute { +public: + WriteDoorLockRemoteProgrammingEventMask() + : WriteAttribute("remote-programming-event-mask") + { + AddArgument("attr-name", "remote-programming-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteDoorLockRemoteProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000046) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeRemoteProgrammingEventMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock RemoteProgrammingEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockRemoteProgrammingEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockRemoteProgrammingEventMask() + : SubscribeAttribute("remote-programming-event-mask") + { + } + + ~SubscribeAttributeDoorLockRemoteProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000046) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeRemoteProgrammingEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RemoteProgrammingEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute RFIDProgrammingEventMask + */ +class ReadDoorLockRFIDProgrammingEventMask : public ReadAttribute { +public: + ReadDoorLockRFIDProgrammingEventMask() + : ReadAttribute("rfidprogramming-event-mask") + { + } + + ~ReadDoorLockRFIDProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000047) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeRFIDProgrammingEventMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RFIDProgrammingEventMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "DoorLock RFIDProgrammingEventMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteDoorLockRFIDProgrammingEventMask : public WriteAttribute { +public: + WriteDoorLockRFIDProgrammingEventMask() + : WriteAttribute("rfidprogramming-event-mask") + { + AddArgument("attr-name", "rfidprogramming-event-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteDoorLockRFIDProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000047) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeRFIDProgrammingEventMaskWithValue:value params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "DoorLock RFIDProgrammingEventMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeDoorLockRFIDProgrammingEventMask : public SubscribeAttribute { +public: + SubscribeAttributeDoorLockRFIDProgrammingEventMask() + : SubscribeAttribute("rfidprogramming-event-mask") + { + } + + ~SubscribeAttributeDoorLockRFIDProgrammingEventMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000047) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeRFIDProgrammingEventMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.RFIDProgrammingEventMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24236,30 +27809,28 @@ class SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset : public Subscr /* * Attribute GeneratedCommandList */ -class ReadEthernetNetworkDiagnosticsGeneratedCommandList : public ReadAttribute { +class ReadDoorLockGeneratedCommandList : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsGeneratedCommandList() + ReadDoorLockGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadEthernetNetworkDiagnosticsGeneratedCommandList() {} + ~ReadDoorLockGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24267,37 +27838,35 @@ class ReadEthernetNetworkDiagnosticsGeneratedCommandList : public ReadAttribute } }; -class SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeDoorLockGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList() + SubscribeAttributeDoorLockGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList() {} + ~SubscribeAttributeDoorLockGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24311,30 +27880,28 @@ class SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList : public /* * Attribute AcceptedCommandList */ -class ReadEthernetNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { +class ReadDoorLockAcceptedCommandList : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsAcceptedCommandList() + ReadDoorLockAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadEthernetNetworkDiagnosticsAcceptedCommandList() {} + ~ReadDoorLockAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24342,22 +27909,20 @@ class ReadEthernetNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeDoorLockAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList() + SubscribeAttributeDoorLockAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList() {} + ~SubscribeAttributeDoorLockAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -24367,8 +27932,7 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList : public S params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", - [value description]); + NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -24386,30 +27950,28 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList : public S /* * Attribute AttributeList */ -class ReadEthernetNetworkDiagnosticsAttributeList : public ReadAttribute { +class ReadDoorLockAttributeList : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsAttributeList() + ReadDoorLockAttributeList() : ReadAttribute("attribute-list") { } - ~ReadEthernetNetworkDiagnosticsAttributeList() {} + ~ReadDoorLockAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", [value description]); + NSLog(@"DoorLock.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24417,22 +27979,20 @@ class ReadEthernetNetworkDiagnosticsAttributeList : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsAttributeList : public SubscribeAttribute { +class SubscribeAttributeDoorLockAttributeList : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsAttributeList() + SubscribeAttributeDoorLockAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsAttributeList() {} + ~SubscribeAttributeDoorLockAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -24442,8 +28002,7 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAttributeList : public Subscri params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", - [value description]); + NSLog(@"DoorLock.AttributeList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -24461,30 +28020,28 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAttributeList : public Subscri /* * Attribute FeatureMap */ -class ReadEthernetNetworkDiagnosticsFeatureMap : public ReadAttribute { +class ReadDoorLockFeatureMap : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsFeatureMap() + ReadDoorLockFeatureMap() : ReadAttribute("feature-map") { } - ~ReadEthernetNetworkDiagnosticsFeatureMap() {} + ~ReadDoorLockFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); + NSLog(@"DoorLock.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24492,22 +28049,20 @@ class ReadEthernetNetworkDiagnosticsFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap : public SubscribeAttribute { +class SubscribeAttributeDoorLockFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap() + SubscribeAttributeDoorLockFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap() {} + ~SubscribeAttributeDoorLockFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -24517,7 +28072,7 @@ class SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap : public SubscribeA params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); + NSLog(@"DoorLock.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -24535,30 +28090,28 @@ class SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap : public SubscribeA /* * Attribute ClusterRevision */ -class ReadEthernetNetworkDiagnosticsClusterRevision : public ReadAttribute { +class ReadDoorLockClusterRevision : public ReadAttribute { public: - ReadEthernetNetworkDiagnosticsClusterRevision() + ReadDoorLockClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadEthernetNetworkDiagnosticsClusterRevision() {} + ~ReadDoorLockClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", [value description]); + NSLog(@"DoorLock.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "EthernetNetworkDiagnostics ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "DoorLock ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24566,22 +28119,20 @@ class ReadEthernetNetworkDiagnosticsClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public SubscribeAttribute { +class SubscribeAttributeDoorLockClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision() + SubscribeAttributeDoorLockClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision() {} + ~SubscribeAttributeDoorLockClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -24591,8 +28142,7 @@ class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public Subsc params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", - [value description]); + NSLog(@"DoorLock.ClusterRevision response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -24608,130 +28158,317 @@ class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public Subsc }; /*----------------------------------------------------------------------------*\ -| Cluster FanControl | 0x0202 | +| Cluster ElectricalMeasurement | 0x0B04 | |------------------------------------------------------------------------------| | Commands: | | +| * GetProfileInfoCommand | 0x00 | +| * GetMeasurementProfileCommand | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * FanMode | 0x0000 | -| * FanModeSequence | 0x0001 | -| * PercentSetting | 0x0002 | -| * PercentCurrent | 0x0003 | -| * SpeedMax | 0x0004 | -| * SpeedSetting | 0x0005 | -| * SpeedCurrent | 0x0006 | -| * RockSupport | 0x0007 | -| * RockSetting | 0x0008 | -| * WindSupport | 0x0009 | -| * WindSetting | 0x000A | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute FanMode - */ -class ReadFanControlFanMode : public ReadAttribute { -public: - ReadFanControlFanMode() - : ReadAttribute("fan-mode") - { - } - - ~ReadFanControlFanMode() {} +| * MeasurementType | 0x0000 | +| * DcVoltage | 0x0100 | +| * DcVoltageMin | 0x0101 | +| * DcVoltageMax | 0x0102 | +| * DcCurrent | 0x0103 | +| * DcCurrentMin | 0x0104 | +| * DcCurrentMax | 0x0105 | +| * DcPower | 0x0106 | +| * DcPowerMin | 0x0107 | +| * DcPowerMax | 0x0108 | +| * DcVoltageMultiplier | 0x0200 | +| * DcVoltageDivisor | 0x0201 | +| * DcCurrentMultiplier | 0x0202 | +| * DcCurrentDivisor | 0x0203 | +| * DcPowerMultiplier | 0x0204 | +| * DcPowerDivisor | 0x0205 | +| * AcFrequency | 0x0300 | +| * AcFrequencyMin | 0x0301 | +| * AcFrequencyMax | 0x0302 | +| * NeutralCurrent | 0x0303 | +| * TotalActivePower | 0x0304 | +| * TotalReactivePower | 0x0305 | +| * TotalApparentPower | 0x0306 | +| * Measured1stHarmonicCurrent | 0x0307 | +| * Measured3rdHarmonicCurrent | 0x0308 | +| * Measured5thHarmonicCurrent | 0x0309 | +| * Measured7thHarmonicCurrent | 0x030A | +| * Measured9thHarmonicCurrent | 0x030B | +| * Measured11thHarmonicCurrent | 0x030C | +| * MeasuredPhase1stHarmonicCurrent | 0x030D | +| * MeasuredPhase3rdHarmonicCurrent | 0x030E | +| * MeasuredPhase5thHarmonicCurrent | 0x030F | +| * MeasuredPhase7thHarmonicCurrent | 0x0310 | +| * MeasuredPhase9thHarmonicCurrent | 0x0311 | +| * MeasuredPhase11thHarmonicCurrent | 0x0312 | +| * AcFrequencyMultiplier | 0x0400 | +| * AcFrequencyDivisor | 0x0401 | +| * PowerMultiplier | 0x0402 | +| * PowerDivisor | 0x0403 | +| * HarmonicCurrentMultiplier | 0x0404 | +| * PhaseHarmonicCurrentMultiplier | 0x0405 | +| * InstantaneousVoltage | 0x0500 | +| * InstantaneousLineCurrent | 0x0501 | +| * InstantaneousActiveCurrent | 0x0502 | +| * InstantaneousReactiveCurrent | 0x0503 | +| * InstantaneousPower | 0x0504 | +| * RmsVoltage | 0x0505 | +| * RmsVoltageMin | 0x0506 | +| * RmsVoltageMax | 0x0507 | +| * RmsCurrent | 0x0508 | +| * RmsCurrentMin | 0x0509 | +| * RmsCurrentMax | 0x050A | +| * ActivePower | 0x050B | +| * ActivePowerMin | 0x050C | +| * ActivePowerMax | 0x050D | +| * ReactivePower | 0x050E | +| * ApparentPower | 0x050F | +| * PowerFactor | 0x0510 | +| * AverageRmsVoltageMeasurementPeriod | 0x0511 | +| * AverageRmsUnderVoltageCounter | 0x0513 | +| * RmsExtremeOverVoltagePeriod | 0x0514 | +| * RmsExtremeUnderVoltagePeriod | 0x0515 | +| * RmsVoltageSagPeriod | 0x0516 | +| * RmsVoltageSwellPeriod | 0x0517 | +| * AcVoltageMultiplier | 0x0600 | +| * AcVoltageDivisor | 0x0601 | +| * AcCurrentMultiplier | 0x0602 | +| * AcCurrentDivisor | 0x0603 | +| * AcPowerMultiplier | 0x0604 | +| * AcPowerDivisor | 0x0605 | +| * OverloadAlarmsMask | 0x0700 | +| * VoltageOverload | 0x0701 | +| * CurrentOverload | 0x0702 | +| * AcOverloadAlarmsMask | 0x0800 | +| * AcVoltageOverload | 0x0801 | +| * AcCurrentOverload | 0x0802 | +| * AcActivePowerOverload | 0x0803 | +| * AcReactivePowerOverload | 0x0804 | +| * AverageRmsOverVoltage | 0x0805 | +| * AverageRmsUnderVoltage | 0x0806 | +| * RmsExtremeOverVoltage | 0x0807 | +| * RmsExtremeUnderVoltage | 0x0808 | +| * RmsVoltageSag | 0x0809 | +| * RmsVoltageSwell | 0x080A | +| * LineCurrentPhaseB | 0x0901 | +| * ActiveCurrentPhaseB | 0x0902 | +| * ReactiveCurrentPhaseB | 0x0903 | +| * RmsVoltagePhaseB | 0x0905 | +| * RmsVoltageMinPhaseB | 0x0906 | +| * RmsVoltageMaxPhaseB | 0x0907 | +| * RmsCurrentPhaseB | 0x0908 | +| * RmsCurrentMinPhaseB | 0x0909 | +| * RmsCurrentMaxPhaseB | 0x090A | +| * ActivePowerPhaseB | 0x090B | +| * ActivePowerMinPhaseB | 0x090C | +| * ActivePowerMaxPhaseB | 0x090D | +| * ReactivePowerPhaseB | 0x090E | +| * ApparentPowerPhaseB | 0x090F | +| * PowerFactorPhaseB | 0x0910 | +| * AverageRmsVoltageMeasurementPeriodPhaseB | 0x0911 | +| * AverageRmsOverVoltageCounterPhaseB | 0x0912 | +| * AverageRmsUnderVoltageCounterPhaseB | 0x0913 | +| * RmsExtremeOverVoltagePeriodPhaseB | 0x0914 | +| * RmsExtremeUnderVoltagePeriodPhaseB | 0x0915 | +| * RmsVoltageSagPeriodPhaseB | 0x0916 | +| * RmsVoltageSwellPeriodPhaseB | 0x0917 | +| * LineCurrentPhaseC | 0x0A01 | +| * ActiveCurrentPhaseC | 0x0A02 | +| * ReactiveCurrentPhaseC | 0x0A03 | +| * RmsVoltagePhaseC | 0x0A05 | +| * RmsVoltageMinPhaseC | 0x0A06 | +| * RmsVoltageMaxPhaseC | 0x0A07 | +| * RmsCurrentPhaseC | 0x0A08 | +| * RmsCurrentMinPhaseC | 0x0A09 | +| * RmsCurrentMaxPhaseC | 0x0A0A | +| * ActivePowerPhaseC | 0x0A0B | +| * ActivePowerMinPhaseC | 0x0A0C | +| * ActivePowerMaxPhaseC | 0x0A0D | +| * ReactivePowerPhaseC | 0x0A0E | +| * ApparentPowerPhaseC | 0x0A0F | +| * PowerFactorPhaseC | 0x0A10 | +| * AverageRmsVoltageMeasurementPeriodPhaseC | 0x0A11 | +| * AverageRmsOverVoltageCounterPhaseC | 0x0A12 | +| * AverageRmsUnderVoltageCounterPhaseC | 0x0A13 | +| * RmsExtremeOverVoltagePeriodPhaseC | 0x0A14 | +| * RmsExtremeUnderVoltagePeriodPhaseC | 0x0A15 | +| * RmsVoltageSagPeriodPhaseC | 0x0A16 | +| * RmsVoltageSwellPeriodPhaseC | 0x0A17 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command GetProfileInfoCommand + */ +class ElectricalMeasurementGetProfileInfoCommand : public ClusterCommand { +public: + ElectricalMeasurementGetProfileInfoCommand() + : ClusterCommand("get-profile-info-command") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFanModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.FanMode response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "FanControl FanMode read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPElectricalMeasurementClusterGetProfileInfoCommandParams 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 getProfileInfoCommandWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Type mRequest; }; -class WriteFanControlFanMode : public WriteAttribute { +/* + * Command GetMeasurementProfileCommand + */ +class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand { public: - WriteFanControlFanMode() - : WriteAttribute("fan-mode") + ElectricalMeasurementGetMeasurementProfileCommand() + : ClusterCommand("get-measurement-profile-command") { - AddArgument("attr-name", "fan-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("AttributeId", 0, UINT16_MAX, &mAttributeId); + AddArgument("StartTime", 0, UINT32_MAX, &mStartTime); + AddArgument("NumberOfIntervals", 0, UINT8_MAX, &mNumberOfIntervals); + ClusterCommand::AddArguments(); } - ~WriteFanControlFanMode() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) command (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs + __auto_type * params = [[CHIPElectricalMeasurementClusterGetMeasurementProfileCommandParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeFanModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FanControl FanMode write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + params.attributeId = [NSNumber numberWithUnsignedShort:mAttributeId]; + params.startTime = [NSNumber numberWithUnsignedInt:mStartTime]; + params.numberOfIntervals = [NSNumber numberWithUnsignedChar:mNumberOfIntervals]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getMeasurementProfileCommandWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } return chipError; } private: - uint8_t mValue; + chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type mRequest; + uint16_t mAttributeId; + uint32_t mStartTime; + uint8_t mNumberOfIntervals; }; -class SubscribeAttributeFanControlFanMode : public SubscribeAttribute { +/* + * Attribute MeasurementType + */ +class ReadElectricalMeasurementMeasurementType : public ReadAttribute { public: - SubscribeAttributeFanControlFanMode() - : SubscribeAttribute("fan-mode") + ReadElectricalMeasurementMeasurementType() + : ReadAttribute("measurement-type") { } - ~SubscribeAttributeFanControlFanMode() {} + ~ReadElectricalMeasurementMeasurementType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMeasurementTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement MeasurementType read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeElectricalMeasurementMeasurementType : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementMeasurementType() + : SubscribeAttribute("measurement-type") + { + } + + ~SubscribeAttributeElectricalMeasurementMeasurementType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFanModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.FanMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasurementTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24743,30 +28480,32 @@ class SubscribeAttributeFanControlFanMode : public SubscribeAttribute { }; /* - * Attribute FanModeSequence + * Attribute DcVoltage */ -class ReadFanControlFanModeSequence : public ReadAttribute { +class ReadElectricalMeasurementDcVoltage : public ReadAttribute { public: - ReadFanControlFanModeSequence() - : ReadAttribute("fan-mode-sequence") + ReadElectricalMeasurementDcVoltage() + : ReadAttribute("dc-voltage") { } - ~ReadFanControlFanModeSequence() {} + ~ReadElectricalMeasurementDcVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000100) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFanModeSequenceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.FanModeSequence response %@", [value description]); + [cluster readAttributeDcVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl FanModeSequence read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24774,74 +28513,36 @@ class ReadFanControlFanModeSequence : public ReadAttribute { } }; -class WriteFanControlFanModeSequence : public WriteAttribute { -public: - WriteFanControlFanModeSequence() - : WriteAttribute("fan-mode-sequence") - { - AddArgument("attr-name", "fan-mode-sequence"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteFanControlFanModeSequence() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000001) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeFanModeSequenceWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FanControl FanModeSequence write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeFanControlFanModeSequence : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcVoltage : public SubscribeAttribute { public: - SubscribeAttributeFanControlFanModeSequence() - : SubscribeAttribute("fan-mode-sequence") + SubscribeAttributeElectricalMeasurementDcVoltage() + : SubscribeAttribute("dc-voltage") { } - ~SubscribeAttributeFanControlFanModeSequence() {} + ~SubscribeAttributeElectricalMeasurementDcVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000100) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFanModeSequenceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.FanModeSequence response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltage response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24853,30 +28554,32 @@ class SubscribeAttributeFanControlFanModeSequence : public SubscribeAttribute { }; /* - * Attribute PercentSetting + * Attribute DcVoltageMin */ -class ReadFanControlPercentSetting : public ReadAttribute { +class ReadElectricalMeasurementDcVoltageMin : public ReadAttribute { public: - ReadFanControlPercentSetting() - : ReadAttribute("percent-setting") + ReadElectricalMeasurementDcVoltageMin() + : ReadAttribute("dc-voltage-min") { } - ~ReadFanControlPercentSetting() {} + ~ReadElectricalMeasurementDcVoltageMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000101) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePercentSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.PercentSetting response %@", [value description]); + [cluster readAttributeDcVoltageMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageMin response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl PercentSetting read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcVoltageMin read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24884,74 +28587,36 @@ class ReadFanControlPercentSetting : public ReadAttribute { } }; -class WriteFanControlPercentSetting : public WriteAttribute { -public: - WriteFanControlPercentSetting() - : WriteAttribute("percent-setting") - { - AddArgument("attr-name", "percent-setting"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteFanControlPercentSetting() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000002) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributePercentSettingWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "FanControl PercentSetting write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcVoltageMin : public SubscribeAttribute { public: - SubscribeAttributeFanControlPercentSetting() - : SubscribeAttribute("percent-setting") + SubscribeAttributeElectricalMeasurementDcVoltageMin() + : SubscribeAttribute("dc-voltage-min") { } - ~SubscribeAttributeFanControlPercentSetting() {} + ~SubscribeAttributeElectricalMeasurementDcVoltageMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000101) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePercentSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.PercentSetting response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcVoltageMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageMin response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -24963,30 +28628,32 @@ class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { }; /* - * Attribute PercentCurrent + * Attribute DcVoltageMax */ -class ReadFanControlPercentCurrent : public ReadAttribute { +class ReadElectricalMeasurementDcVoltageMax : public ReadAttribute { public: - ReadFanControlPercentCurrent() - : ReadAttribute("percent-current") + ReadElectricalMeasurementDcVoltageMax() + : ReadAttribute("dc-voltage-max") { } - ~ReadFanControlPercentCurrent() {} + ~ReadElectricalMeasurementDcVoltageMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000102) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePercentCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.PercentCurrent response %@", [value description]); + [cluster readAttributeDcVoltageMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl PercentCurrent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcVoltageMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -24994,34 +28661,36 @@ class ReadFanControlPercentCurrent : public ReadAttribute { } }; -class SubscribeAttributeFanControlPercentCurrent : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcVoltageMax : public SubscribeAttribute { public: - SubscribeAttributeFanControlPercentCurrent() - : SubscribeAttribute("percent-current") + SubscribeAttributeElectricalMeasurementDcVoltageMax() + : SubscribeAttribute("dc-voltage-max") { } - ~SubscribeAttributeFanControlPercentCurrent() {} + ~SubscribeAttributeElectricalMeasurementDcVoltageMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000102) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePercentCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.PercentCurrent response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcVoltageMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25033,30 +28702,32 @@ class SubscribeAttributeFanControlPercentCurrent : public SubscribeAttribute { }; /* - * Attribute SpeedMax + * Attribute DcCurrent */ -class ReadFanControlSpeedMax : public ReadAttribute { +class ReadElectricalMeasurementDcCurrent : public ReadAttribute { public: - ReadFanControlSpeedMax() - : ReadAttribute("speed-max") + ReadElectricalMeasurementDcCurrent() + : ReadAttribute("dc-current") { } - ~ReadFanControlSpeedMax() {} + ~ReadElectricalMeasurementDcCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000103) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSpeedMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.SpeedMax response %@", [value description]); + [cluster readAttributeDcCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl SpeedMax read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25064,34 +28735,36 @@ class ReadFanControlSpeedMax : public ReadAttribute { } }; -class SubscribeAttributeFanControlSpeedMax : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcCurrent : public SubscribeAttribute { public: - SubscribeAttributeFanControlSpeedMax() - : SubscribeAttribute("speed-max") + SubscribeAttributeElectricalMeasurementDcCurrent() + : SubscribeAttribute("dc-current") { } - ~SubscribeAttributeFanControlSpeedMax() {} + ~SubscribeAttributeElectricalMeasurementDcCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000103) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSpeedMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.SpeedMax response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25103,30 +28776,32 @@ class SubscribeAttributeFanControlSpeedMax : public SubscribeAttribute { }; /* - * Attribute SpeedSetting + * Attribute DcCurrentMin */ -class ReadFanControlSpeedSetting : public ReadAttribute { +class ReadElectricalMeasurementDcCurrentMin : public ReadAttribute { public: - ReadFanControlSpeedSetting() - : ReadAttribute("speed-setting") + ReadElectricalMeasurementDcCurrentMin() + : ReadAttribute("dc-current-min") { } - ~ReadFanControlSpeedSetting() {} + ~ReadElectricalMeasurementDcCurrentMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000104) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSpeedSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.SpeedSetting response %@", [value description]); + [cluster readAttributeDcCurrentMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrentMin response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl SpeedSetting read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcCurrentMin read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25134,70 +28809,32 @@ class ReadFanControlSpeedSetting : public ReadAttribute { } }; -class WriteFanControlSpeedSetting : public WriteAttribute { -public: - WriteFanControlSpeedSetting() - : WriteAttribute("speed-setting") - { - AddArgument("attr-name", "speed-setting"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteFanControlSpeedSetting() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000005) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster - writeAttributeSpeedSettingWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FanControl SpeedSetting write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcCurrentMin : public SubscribeAttribute { public: - SubscribeAttributeFanControlSpeedSetting() - : SubscribeAttribute("speed-setting") + SubscribeAttributeElectricalMeasurementDcCurrentMin() + : SubscribeAttribute("dc-current-min") { } - ~SubscribeAttributeFanControlSpeedSetting() {} + ~SubscribeAttributeElectricalMeasurementDcCurrentMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000104) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSpeedSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeDcCurrentMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.SpeedSetting response %@", [value description]); + NSLog(@"ElectricalMeasurement.DcCurrentMin response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -25213,30 +28850,32 @@ class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { }; /* - * Attribute SpeedCurrent + * Attribute DcCurrentMax */ -class ReadFanControlSpeedCurrent : public ReadAttribute { +class ReadElectricalMeasurementDcCurrentMax : public ReadAttribute { public: - ReadFanControlSpeedCurrent() - : ReadAttribute("speed-current") + ReadElectricalMeasurementDcCurrentMax() + : ReadAttribute("dc-current-max") { } - ~ReadFanControlSpeedCurrent() {} + ~ReadElectricalMeasurementDcCurrentMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000105) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSpeedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + [cluster readAttributeDcCurrentMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrentMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl SpeedCurrent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcCurrentMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25244,30 +28883,32 @@ class ReadFanControlSpeedCurrent : public ReadAttribute { } }; -class SubscribeAttributeFanControlSpeedCurrent : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcCurrentMax : public SubscribeAttribute { public: - SubscribeAttributeFanControlSpeedCurrent() - : SubscribeAttribute("speed-current") + SubscribeAttributeElectricalMeasurementDcCurrentMax() + : SubscribeAttribute("dc-current-max") { } - ~SubscribeAttributeFanControlSpeedCurrent() {} + ~SubscribeAttributeElectricalMeasurementDcCurrentMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000105) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSpeedCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeDcCurrentMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + NSLog(@"ElectricalMeasurement.DcCurrentMax response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -25283,30 +28924,32 @@ class SubscribeAttributeFanControlSpeedCurrent : public SubscribeAttribute { }; /* - * Attribute RockSupport + * Attribute DcPower */ -class ReadFanControlRockSupport : public ReadAttribute { +class ReadElectricalMeasurementDcPower : public ReadAttribute { public: - ReadFanControlRockSupport() - : ReadAttribute("rock-support") + ReadElectricalMeasurementDcPower() + : ReadAttribute("dc-power") { } - ~ReadFanControlRockSupport() {} + ~ReadElectricalMeasurementDcPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000106) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRockSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.RockSupport response %@", [value description]); + [cluster readAttributeDcPowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl RockSupport read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcPower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25314,34 +28957,36 @@ class ReadFanControlRockSupport : public ReadAttribute { } }; -class SubscribeAttributeFanControlRockSupport : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcPower : public SubscribeAttribute { public: - SubscribeAttributeFanControlRockSupport() - : SubscribeAttribute("rock-support") + SubscribeAttributeElectricalMeasurementDcPower() + : SubscribeAttribute("dc-power") { } - ~SubscribeAttributeFanControlRockSupport() {} + ~SubscribeAttributeElectricalMeasurementDcPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000106) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRockSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.RockSupport response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcPowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPower response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25353,30 +28998,32 @@ class SubscribeAttributeFanControlRockSupport : public SubscribeAttribute { }; /* - * Attribute RockSetting + * Attribute DcPowerMin */ -class ReadFanControlRockSetting : public ReadAttribute { +class ReadElectricalMeasurementDcPowerMin : public ReadAttribute { public: - ReadFanControlRockSetting() - : ReadAttribute("rock-setting") + ReadElectricalMeasurementDcPowerMin() + : ReadAttribute("dc-power-min") { } - ~ReadFanControlRockSetting() {} + ~ReadElectricalMeasurementDcPowerMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000107) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRockSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.RockSetting response %@", [value description]); + [cluster readAttributeDcPowerMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerMin response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl RockSetting read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcPowerMin read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25384,74 +29031,36 @@ class ReadFanControlRockSetting : public ReadAttribute { } }; -class WriteFanControlRockSetting : public WriteAttribute { -public: - WriteFanControlRockSetting() - : WriteAttribute("rock-setting") - { - AddArgument("attr-name", "rock-setting"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteFanControlRockSetting() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000008) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster - writeAttributeRockSettingWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FanControl RockSetting write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeFanControlRockSetting : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcPowerMin : public SubscribeAttribute { public: - SubscribeAttributeFanControlRockSetting() - : SubscribeAttribute("rock-setting") + SubscribeAttributeElectricalMeasurementDcPowerMin() + : SubscribeAttribute("dc-power-min") { } - ~SubscribeAttributeFanControlRockSetting() {} + ~SubscribeAttributeElectricalMeasurementDcPowerMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000107) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRockSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.RockSetting response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcPowerMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerMin response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25463,30 +29072,32 @@ class SubscribeAttributeFanControlRockSetting : public SubscribeAttribute { }; /* - * Attribute WindSupport + * Attribute DcPowerMax */ -class ReadFanControlWindSupport : public ReadAttribute { +class ReadElectricalMeasurementDcPowerMax : public ReadAttribute { public: - ReadFanControlWindSupport() - : ReadAttribute("wind-support") + ReadElectricalMeasurementDcPowerMax() + : ReadAttribute("dc-power-max") { } - ~ReadFanControlWindSupport() {} + ~ReadElectricalMeasurementDcPowerMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000108) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWindSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.WindSupport response %@", [value description]); + [cluster readAttributeDcPowerMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl WindSupport read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcPowerMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25494,34 +29105,36 @@ class ReadFanControlWindSupport : public ReadAttribute { } }; -class SubscribeAttributeFanControlWindSupport : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcPowerMax : public SubscribeAttribute { public: - SubscribeAttributeFanControlWindSupport() - : SubscribeAttribute("wind-support") + SubscribeAttributeElectricalMeasurementDcPowerMax() + : SubscribeAttribute("dc-power-max") { } - ~SubscribeAttributeFanControlWindSupport() {} + ~SubscribeAttributeElectricalMeasurementDcPowerMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000108) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeWindSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.WindSupport response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcPowerMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25533,30 +29146,32 @@ class SubscribeAttributeFanControlWindSupport : public SubscribeAttribute { }; /* - * Attribute WindSetting + * Attribute DcVoltageMultiplier */ -class ReadFanControlWindSetting : public ReadAttribute { +class ReadElectricalMeasurementDcVoltageMultiplier : public ReadAttribute { public: - ReadFanControlWindSetting() - : ReadAttribute("wind-setting") + ReadElectricalMeasurementDcVoltageMultiplier() + : ReadAttribute("dc-voltage-multiplier") { } - ~ReadFanControlWindSetting() {} + ~ReadElectricalMeasurementDcVoltageMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000200) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWindSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.WindSetting response %@", [value description]); + [cluster readAttributeDcVoltageMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl WindSetting read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcVoltageMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25564,74 +29179,37 @@ class ReadFanControlWindSetting : public ReadAttribute { } }; -class WriteFanControlWindSetting : public WriteAttribute { -public: - WriteFanControlWindSetting() - : WriteAttribute("wind-setting") - { - AddArgument("attr-name", "wind-setting"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteFanControlWindSetting() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x0000000A) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster - writeAttributeWindSettingWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FanControl WindSetting write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeFanControlWindSetting : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcVoltageMultiplier : public SubscribeAttribute { public: - SubscribeAttributeFanControlWindSetting() - : SubscribeAttribute("wind-setting") + SubscribeAttributeElectricalMeasurementDcVoltageMultiplier() + : SubscribeAttribute("dc-voltage-multiplier") { } - ~SubscribeAttributeFanControlWindSetting() {} + ~SubscribeAttributeElectricalMeasurementDcVoltageMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000200) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeWindSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.WindSetting response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcVoltageMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25643,30 +29221,32 @@ class SubscribeAttributeFanControlWindSetting : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute DcVoltageDivisor */ -class ReadFanControlGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementDcVoltageDivisor : public ReadAttribute { public: - ReadFanControlGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementDcVoltageDivisor() + : ReadAttribute("dc-voltage-divisor") { } - ~ReadFanControlGeneratedCommandList() {} + ~ReadElectricalMeasurementDcVoltageDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000201) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); + [cluster readAttributeDcVoltageDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcVoltageDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25674,35 +29254,37 @@ class ReadFanControlGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeFanControlGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcVoltageDivisor : public SubscribeAttribute { public: - SubscribeAttributeFanControlGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementDcVoltageDivisor() + : SubscribeAttribute("dc-voltage-divisor") { } - ~SubscribeAttributeFanControlGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementDcVoltageDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000201) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcVoltageDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcVoltageDivisor response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25714,30 +29296,32 @@ class SubscribeAttributeFanControlGeneratedCommandList : public SubscribeAttribu }; /* - * Attribute AcceptedCommandList + * Attribute DcCurrentMultiplier */ -class ReadFanControlAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementDcCurrentMultiplier : public ReadAttribute { public: - ReadFanControlAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementDcCurrentMultiplier() + : ReadAttribute("dc-current-multiplier") { } - ~ReadFanControlAcceptedCommandList() {} + ~ReadElectricalMeasurementDcCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000202) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); + [cluster readAttributeDcCurrentMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrentMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcCurrentMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25745,35 +29329,37 @@ class ReadFanControlAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeFanControlAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcCurrentMultiplier : public SubscribeAttribute { public: - SubscribeAttributeFanControlAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementDcCurrentMultiplier() + : SubscribeAttribute("dc-current-multiplier") { } - ~SubscribeAttributeFanControlAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementDcCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000202) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcCurrentMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrentMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25785,30 +29371,32 @@ class SubscribeAttributeFanControlAcceptedCommandList : public SubscribeAttribut }; /* - * Attribute AttributeList + * Attribute DcCurrentDivisor */ -class ReadFanControlAttributeList : public ReadAttribute { +class ReadElectricalMeasurementDcCurrentDivisor : public ReadAttribute { public: - ReadFanControlAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementDcCurrentDivisor() + : ReadAttribute("dc-current-divisor") { } - ~ReadFanControlAttributeList() {} + ~ReadElectricalMeasurementDcCurrentDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000203) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.AttributeList response %@", [value description]); + [cluster readAttributeDcCurrentDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrentDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcCurrentDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25816,34 +29404,37 @@ class ReadFanControlAttributeList : public ReadAttribute { } }; -class SubscribeAttributeFanControlAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcCurrentDivisor : public SubscribeAttribute { public: - SubscribeAttributeFanControlAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementDcCurrentDivisor() + : SubscribeAttribute("dc-current-divisor") { } - ~SubscribeAttributeFanControlAttributeList() {} + ~SubscribeAttributeElectricalMeasurementDcCurrentDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000203) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDcCurrentDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcCurrentDivisor response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25855,30 +29446,32 @@ class SubscribeAttributeFanControlAttributeList : public SubscribeAttribute { }; /* - * Attribute FeatureMap + * Attribute DcPowerMultiplier */ -class ReadFanControlFeatureMap : public ReadAttribute { +class ReadElectricalMeasurementDcPowerMultiplier : public ReadAttribute { public: - ReadFanControlFeatureMap() - : ReadAttribute("feature-map") + ReadElectricalMeasurementDcPowerMultiplier() + : ReadAttribute("dc-power-multiplier") { } - ~ReadFanControlFeatureMap() {} + ~ReadElectricalMeasurementDcPowerMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000204) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.FeatureMap response %@", [value description]); + [cluster readAttributeDcPowerMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcPowerMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25886,37 +29479,40 @@ class ReadFanControlFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeFanControlFeatureMap : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcPowerMultiplier : public SubscribeAttribute { public: - SubscribeAttributeFanControlFeatureMap() - : SubscribeAttribute("feature-map") + SubscribeAttributeElectricalMeasurementDcPowerMultiplier() + : SubscribeAttribute("dc-power-multiplier") { } - ~SubscribeAttributeFanControlFeatureMap() {} + ~SubscribeAttributeElectricalMeasurementDcPowerMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000204) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.FeatureMap response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } + [cluster subscribeAttributeDcPowerMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } chip::System::Clock::Timeout GetWaitDuration() const override { @@ -25925,30 +29521,32 @@ class SubscribeAttributeFanControlFeatureMap : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute DcPowerDivisor */ -class ReadFanControlClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementDcPowerDivisor : public ReadAttribute { public: - ReadFanControlClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementDcPowerDivisor() + : ReadAttribute("dc-power-divisor") { } - ~ReadFanControlClusterRevision() {} + ~ReadElectricalMeasurementDcPowerDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000205) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.ClusterRevision response %@", [value description]); + [cluster readAttributeDcPowerDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FanControl ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement DcPowerDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -25956,34 +29554,37 @@ class ReadFanControlClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeFanControlClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementDcPowerDivisor : public SubscribeAttribute { public: - SubscribeAttributeFanControlClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementDcPowerDivisor() + : SubscribeAttribute("dc-power-divisor") { } - ~SubscribeAttributeFanControlClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementDcPowerDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000205) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FanControl.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeDcPowerDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.DcPowerDivisor response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -25994,47 +29595,33 @@ class SubscribeAttributeFanControlClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster FixedLabel | 0x0040 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * LabelList | 0x0000 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute LabelList + * Attribute AcFrequency */ -class ReadFixedLabelLabelList : public ReadAttribute { +class ReadElectricalMeasurementAcFrequency : public ReadAttribute { public: - ReadFixedLabelLabelList() - : ReadAttribute("label-list") + ReadElectricalMeasurementAcFrequency() + : ReadAttribute("ac-frequency") { } - ~ReadFixedLabelLabelList() {} + ~ReadElectricalMeasurementAcFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000300) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.LabelList response %@", [value description]); + [cluster readAttributeAcFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequency response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FixedLabel LabelList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcFrequency read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26042,34 +29629,36 @@ class ReadFixedLabelLabelList : public ReadAttribute { } }; -class SubscribeAttributeFixedLabelLabelList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcFrequency : public SubscribeAttribute { public: - SubscribeAttributeFixedLabelLabelList() - : SubscribeAttribute("label-list") + SubscribeAttributeElectricalMeasurementAcFrequency() + : SubscribeAttribute("ac-frequency") { } - ~SubscribeAttributeFixedLabelLabelList() {} + ~SubscribeAttributeElectricalMeasurementAcFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000300) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLabelListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.LabelList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequency response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26081,30 +29670,32 @@ class SubscribeAttributeFixedLabelLabelList : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute AcFrequencyMin */ -class ReadFixedLabelGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementAcFrequencyMin : public ReadAttribute { public: - ReadFixedLabelGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementAcFrequencyMin() + : ReadAttribute("ac-frequency-min") { } - ~ReadFixedLabelGeneratedCommandList() {} + ~ReadElectricalMeasurementAcFrequencyMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000301) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); + [cluster readAttributeAcFrequencyMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyMin response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FixedLabel GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcFrequencyMin read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26112,35 +29703,37 @@ class ReadFixedLabelGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeFixedLabelGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcFrequencyMin : public SubscribeAttribute { public: - SubscribeAttributeFixedLabelGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementAcFrequencyMin() + : SubscribeAttribute("ac-frequency-min") { } - ~SubscribeAttributeFixedLabelGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementAcFrequencyMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000301) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeAcFrequencyMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyMin response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26152,30 +29745,32 @@ class SubscribeAttributeFixedLabelGeneratedCommandList : public SubscribeAttribu }; /* - * Attribute AcceptedCommandList + * Attribute AcFrequencyMax */ -class ReadFixedLabelAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementAcFrequencyMax : public ReadAttribute { public: - ReadFixedLabelAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementAcFrequencyMax() + : ReadAttribute("ac-frequency-max") { } - ~ReadFixedLabelAcceptedCommandList() {} + ~ReadElectricalMeasurementAcFrequencyMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000302) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); + [cluster readAttributeAcFrequencyMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FixedLabel AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcFrequencyMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26183,35 +29778,37 @@ class ReadFixedLabelAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeFixedLabelAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcFrequencyMax : public SubscribeAttribute { public: - SubscribeAttributeFixedLabelAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementAcFrequencyMax() + : SubscribeAttribute("ac-frequency-max") { } - ~SubscribeAttributeFixedLabelAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementAcFrequencyMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000302) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeAcFrequencyMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26223,30 +29820,32 @@ class SubscribeAttributeFixedLabelAcceptedCommandList : public SubscribeAttribut }; /* - * Attribute AttributeList + * Attribute NeutralCurrent */ -class ReadFixedLabelAttributeList : public ReadAttribute { +class ReadElectricalMeasurementNeutralCurrent : public ReadAttribute { public: - ReadFixedLabelAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementNeutralCurrent() + : ReadAttribute("neutral-current") { } - ~ReadFixedLabelAttributeList() {} + ~ReadElectricalMeasurementNeutralCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000303) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.AttributeList response %@", [value description]); + [cluster readAttributeNeutralCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.NeutralCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FixedLabel AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement NeutralCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26254,34 +29853,37 @@ class ReadFixedLabelAttributeList : public ReadAttribute { } }; -class SubscribeAttributeFixedLabelAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementNeutralCurrent : public SubscribeAttribute { public: - SubscribeAttributeFixedLabelAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementNeutralCurrent() + : SubscribeAttribute("neutral-current") { } - ~SubscribeAttributeFixedLabelAttributeList() {} + ~SubscribeAttributeElectricalMeasurementNeutralCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000303) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNeutralCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.NeutralCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26293,30 +29895,32 @@ class SubscribeAttributeFixedLabelAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute TotalActivePower */ -class ReadFixedLabelClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementTotalActivePower : public ReadAttribute { public: - ReadFixedLabelClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementTotalActivePower() + : ReadAttribute("total-active-power") { } - ~ReadFixedLabelClusterRevision() {} + ~ReadElectricalMeasurementTotalActivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000304) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); + [cluster readAttributeTotalActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.TotalActivePower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FixedLabel ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement TotalActivePower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26324,34 +29928,37 @@ class ReadFixedLabelClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeFixedLabelClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementTotalActivePower : public SubscribeAttribute { public: - SubscribeAttributeFixedLabelClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementTotalActivePower() + : SubscribeAttribute("total-active-power") { } - ~SubscribeAttributeFixedLabelClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementTotalActivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000304) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeTotalActivePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.TotalActivePower response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26362,50 +29969,33 @@ class SubscribeAttributeFixedLabelClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster FlowMeasurement | 0x0404 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute MeasuredValue + * Attribute TotalReactivePower */ -class ReadFlowMeasurementMeasuredValue : public ReadAttribute { +class ReadElectricalMeasurementTotalReactivePower : public ReadAttribute { public: - ReadFlowMeasurementMeasuredValue() - : ReadAttribute("measured-value") + ReadElectricalMeasurementTotalReactivePower() + : ReadAttribute("total-reactive-power") { } - ~ReadFlowMeasurementMeasuredValue() {} + ~ReadElectricalMeasurementTotalReactivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000305) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); + [cluster readAttributeTotalReactivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.TotalReactivePower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement TotalReactivePower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26413,34 +30003,37 @@ class ReadFlowMeasurementMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeFlowMeasurementMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementTotalReactivePower : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementMeasuredValue() - : SubscribeAttribute("measured-value") + SubscribeAttributeElectricalMeasurementTotalReactivePower() + : SubscribeAttribute("total-reactive-power") { } - ~SubscribeAttributeFlowMeasurementMeasuredValue() {} + ~SubscribeAttributeElectricalMeasurementTotalReactivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000305) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeTotalReactivePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.TotalReactivePower response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26452,30 +30045,32 @@ class SubscribeAttributeFlowMeasurementMeasuredValue : public SubscribeAttribute }; /* - * Attribute MinMeasuredValue + * Attribute TotalApparentPower */ -class ReadFlowMeasurementMinMeasuredValue : public ReadAttribute { +class ReadElectricalMeasurementTotalApparentPower : public ReadAttribute { public: - ReadFlowMeasurementMinMeasuredValue() - : ReadAttribute("min-measured-value") + ReadElectricalMeasurementTotalApparentPower() + : ReadAttribute("total-apparent-power") { } - ~ReadFlowMeasurementMinMeasuredValue() {} + ~ReadElectricalMeasurementTotalApparentPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000306) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); + [cluster readAttributeTotalApparentPowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.TotalApparentPower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement TotalApparentPower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -26483,35 +30078,37 @@ class ReadFlowMeasurementMinMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeFlowMeasurementMinMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementTotalApparentPower : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementMinMeasuredValue() - : SubscribeAttribute("min-measured-value") + SubscribeAttributeElectricalMeasurementTotalApparentPower() + : SubscribeAttribute("total-apparent-power") { } - ~SubscribeAttributeFlowMeasurementMinMeasuredValue() {} + ~SubscribeAttributeElectricalMeasurementTotalApparentPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000306) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeTotalApparentPowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.TotalApparentPower response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26523,66 +30120,72 @@ class SubscribeAttributeFlowMeasurementMinMeasuredValue : public SubscribeAttrib }; /* - * Attribute MaxMeasuredValue + * Attribute Measured1stHarmonicCurrent */ -class ReadFlowMeasurementMaxMeasuredValue : public ReadAttribute { +class ReadElectricalMeasurementMeasured1stHarmonicCurrent : public ReadAttribute { public: - ReadFlowMeasurementMaxMeasuredValue() - : ReadAttribute("max-measured-value") + ReadElectricalMeasurementMeasured1stHarmonicCurrent() + : ReadAttribute("measured1st-harmonic-current") { } - ~ReadFlowMeasurementMaxMeasuredValue() {} + ~ReadElectricalMeasurementMeasured1stHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000307) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeMeasured1stHarmonicCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured1stHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement Measured1stHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeFlowMeasurementMaxMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasured1stHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementMaxMeasuredValue() - : SubscribeAttribute("max-measured-value") + SubscribeAttributeElectricalMeasurementMeasured1stHarmonicCurrent() + : SubscribeAttribute("measured1st-harmonic-current") { } - ~SubscribeAttributeFlowMeasurementMaxMeasuredValue() {} + ~SubscribeAttributeElectricalMeasurementMeasured1stHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000307) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeMeasured1stHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured1stHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26594,65 +30197,72 @@ class SubscribeAttributeFlowMeasurementMaxMeasuredValue : public SubscribeAttrib }; /* - * Attribute Tolerance + * Attribute Measured3rdHarmonicCurrent */ -class ReadFlowMeasurementTolerance : public ReadAttribute { +class ReadElectricalMeasurementMeasured3rdHarmonicCurrent : public ReadAttribute { public: - ReadFlowMeasurementTolerance() - : ReadAttribute("tolerance") + ReadElectricalMeasurementMeasured3rdHarmonicCurrent() + : ReadAttribute("measured3rd-harmonic-current") { } - ~ReadFlowMeasurementTolerance() {} + ~ReadElectricalMeasurementMeasured3rdHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000308) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeMeasured3rdHarmonicCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured3rdHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement Measured3rdHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeFlowMeasurementTolerance : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasured3rdHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementTolerance() - : SubscribeAttribute("tolerance") + SubscribeAttributeElectricalMeasurementMeasured3rdHarmonicCurrent() + : SubscribeAttribute("measured3rd-harmonic-current") { } - ~SubscribeAttributeFlowMeasurementTolerance() {} + ~SubscribeAttributeElectricalMeasurementMeasured3rdHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000308) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasured3rdHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured3rdHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26664,66 +30274,72 @@ class SubscribeAttributeFlowMeasurementTolerance : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute Measured5thHarmonicCurrent */ -class ReadFlowMeasurementGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementMeasured5thHarmonicCurrent : public ReadAttribute { public: - ReadFlowMeasurementGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementMeasured5thHarmonicCurrent() + : ReadAttribute("measured5th-harmonic-current") { } - ~ReadFlowMeasurementGeneratedCommandList() {} + ~ReadElectricalMeasurementMeasured5thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000309) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.GeneratedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeMeasured5thHarmonicCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured5thHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement Measured5thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeFlowMeasurementGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasured5thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementMeasured5thHarmonicCurrent() + : SubscribeAttribute("measured5th-harmonic-current") { } - ~SubscribeAttributeFlowMeasurementGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementMeasured5thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000309) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasured5thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured5thHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26735,66 +30351,72 @@ class SubscribeAttributeFlowMeasurementGeneratedCommandList : public SubscribeAt }; /* - * Attribute AcceptedCommandList + * Attribute Measured7thHarmonicCurrent */ -class ReadFlowMeasurementAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementMeasured7thHarmonicCurrent : public ReadAttribute { public: - ReadFlowMeasurementAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementMeasured7thHarmonicCurrent() + : ReadAttribute("measured7th-harmonic-current") { } - ~ReadFlowMeasurementAcceptedCommandList() {} + ~ReadElectricalMeasurementMeasured7thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000030A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeMeasured7thHarmonicCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured7thHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement Measured7thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeFlowMeasurementAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasured7thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementMeasured7thHarmonicCurrent() + : SubscribeAttribute("measured7th-harmonic-current") { } - ~SubscribeAttributeFlowMeasurementAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementMeasured7thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000030A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasured7thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured7thHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26806,65 +30428,72 @@ class SubscribeAttributeFlowMeasurementAcceptedCommandList : public SubscribeAtt }; /* - * Attribute AttributeList + * Attribute Measured9thHarmonicCurrent */ -class ReadFlowMeasurementAttributeList : public ReadAttribute { +class ReadElectricalMeasurementMeasured9thHarmonicCurrent : public ReadAttribute { public: - ReadFlowMeasurementAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementMeasured9thHarmonicCurrent() + : ReadAttribute("measured9th-harmonic-current") { } - ~ReadFlowMeasurementAttributeList() {} + ~ReadElectricalMeasurementMeasured9thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000030B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeMeasured9thHarmonicCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured9thHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement Measured9thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeFlowMeasurementAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasured9thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementMeasured9thHarmonicCurrent() + : SubscribeAttribute("measured9th-harmonic-current") { } - ~SubscribeAttributeFlowMeasurementAttributeList() {} + ~SubscribeAttributeElectricalMeasurementMeasured9thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000030B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasured9thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured9thHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26876,65 +30505,73 @@ class SubscribeAttributeFlowMeasurementAttributeList : public SubscribeAttribute }; /* - * Attribute ClusterRevision + * Attribute Measured11thHarmonicCurrent */ -class ReadFlowMeasurementClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementMeasured11thHarmonicCurrent : public ReadAttribute { public: - ReadFlowMeasurementClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementMeasured11thHarmonicCurrent() + : ReadAttribute("measured11th-harmonic-current") { } - ~ReadFlowMeasurementClusterRevision() {} + ~ReadElectricalMeasurementMeasured11thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000030C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeMeasured11thHarmonicCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.Measured11thHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "FlowMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement Measured11thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeFlowMeasurementClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasured11thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeFlowMeasurementClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementMeasured11thHarmonicCurrent() + : SubscribeAttribute("measured11th-harmonic-current") { } - ~SubscribeAttributeFlowMeasurementClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementMeasured11thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000030C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasured11thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog( + @"ElectricalMeasurement.Measured11thHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -26945,214 +30582,113 @@ class SubscribeAttributeFlowMeasurementClusterRevision : public SubscribeAttribu } }; -/*----------------------------------------------------------------------------*\ -| Cluster GeneralCommissioning | 0x0030 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ArmFailSafe | 0x00 | -| * SetRegulatoryConfig | 0x02 | -| * CommissioningComplete | 0x04 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Breadcrumb | 0x0000 | -| * BasicCommissioningInfo | 0x0001 | -| * RegulatoryConfig | 0x0002 | -| * LocationCapability | 0x0003 | -| * SupportsConcurrentConnection | 0x0004 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command ArmFailSafe + * Attribute MeasuredPhase1stHarmonicCurrent */ -class GeneralCommissioningArmFailSafe : public ClusterCommand { +class ReadElectricalMeasurementMeasuredPhase1stHarmonicCurrent : public ReadAttribute { public: - GeneralCommissioningArmFailSafe() - : ClusterCommand("arm-fail-safe") + ReadElectricalMeasurementMeasuredPhase1stHarmonicCurrent() + : ReadAttribute("measured-phase1st-harmonic-current") { - AddArgument("ExpiryLengthSeconds", 0, UINT16_MAX, &mExpiryLengthSeconds); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementMeasuredPhase1stHarmonicCurrent() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000030D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:mExpiryLengthSeconds]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster armFailSafeWithParams:params - completionHandler:^(CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMeasuredPhase1stHarmonicCurrentWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase1stHarmonicCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint16_t mExpiryLengthSeconds; - uint64_t mBreadcrumb; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement MeasuredPhase1stHarmonicCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command CommissioningComplete - */ -class GeneralCommissioningCommissioningComplete : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementMeasuredPhase1stHarmonicCurrent : public SubscribeAttribute { public: - GeneralCommissioningCommissioningComplete() - : ClusterCommand("commissioning-complete") + SubscribeAttributeElectricalMeasurementMeasuredPhase1stHarmonicCurrent() + : SubscribeAttribute("measured-phase1st-harmonic-current") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementMeasuredPhase1stHarmonicCurrent() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000004) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000030D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGeneralCommissioningClusterCommissioningCompleteParams 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 commissioningCompleteWithCompletionHandler:^( - CHIPGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: -}; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMeasuredPhase1stHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase1stHarmonicCurrent " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command SetRegulatoryConfig - */ -class GeneralCommissioningSetRegulatoryConfig : public ClusterCommand { -public: - GeneralCommissioningSetRegulatoryConfig() - : ClusterCommand("set-regulatory-config") - { - AddArgument("NewRegulatoryConfig", 0, UINT8_MAX, &mNewRegulatoryConfig); - AddArgument("CountryCode", &mCountryCode); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGeneralCommissioningClusterSetRegulatoryConfigParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.newRegulatoryConfig = [NSNumber numberWithUnsignedChar:mNewRegulatoryConfig]; - params.countryCode = [[NSString alloc] initWithBytes:mCountryCode.data() - length:mCountryCode.size() - encoding:NSUTF8StringEncoding]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - setRegulatoryConfigWithParams:params - completionHandler:^(CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: - uint8_t mNewRegulatoryConfig; - chip::ByteSpan mCountryCode; - uint64_t mBreadcrumb; }; /* - * Attribute Breadcrumb + * Attribute MeasuredPhase3rdHarmonicCurrent */ -class ReadGeneralCommissioningBreadcrumb : public ReadAttribute { +class ReadElectricalMeasurementMeasuredPhase3rdHarmonicCurrent : public ReadAttribute { public: - ReadGeneralCommissioningBreadcrumb() - : ReadAttribute("breadcrumb") + ReadElectricalMeasurementMeasuredPhase3rdHarmonicCurrent() + : ReadAttribute("measured-phase3rd-harmonic-current") { } - ~ReadGeneralCommissioningBreadcrumb() {} + ~ReadElectricalMeasurementMeasuredPhase3rdHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000030E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); + [cluster readAttributeMeasuredPhase3rdHarmonicCurrentWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase3rdHarmonicCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning Breadcrumb read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement MeasuredPhase3rdHarmonicCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27160,78 +30696,40 @@ class ReadGeneralCommissioningBreadcrumb : public ReadAttribute { } }; -class WriteGeneralCommissioningBreadcrumb : public WriteAttribute { -public: - WriteGeneralCommissioningBreadcrumb() - : WriteAttribute("breadcrumb") - { - AddArgument("attr-name", "breadcrumb"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteGeneralCommissioningBreadcrumb() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) WriteAttribute (0x00000000) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; - - [cluster writeAttributeBreadcrumbWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning Breadcrumb write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint64_t mValue; -}; - -class SubscribeAttributeGeneralCommissioningBreadcrumb : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasuredPhase3rdHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningBreadcrumb() - : SubscribeAttribute("breadcrumb") + SubscribeAttributeElectricalMeasurementMeasuredPhase3rdHarmonicCurrent() + : SubscribeAttribute("measured-phase3rd-harmonic-current") { } - ~SubscribeAttributeGeneralCommissioningBreadcrumb() {} + ~SubscribeAttributeElectricalMeasurementMeasuredPhase3rdHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000030E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBreadcrumbWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasuredPhase3rdHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase3rdHarmonicCurrent " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27243,33 +30741,33 @@ class SubscribeAttributeGeneralCommissioningBreadcrumb : public SubscribeAttribu }; /* - * Attribute BasicCommissioningInfo + * Attribute MeasuredPhase5thHarmonicCurrent */ -class ReadGeneralCommissioningBasicCommissioningInfo : public ReadAttribute { +class ReadElectricalMeasurementMeasuredPhase5thHarmonicCurrent : public ReadAttribute { public: - ReadGeneralCommissioningBasicCommissioningInfo() - : ReadAttribute("basic-commissioning-info") + ReadElectricalMeasurementMeasuredPhase5thHarmonicCurrent() + : ReadAttribute("measured-phase5th-harmonic-current") { } - ~ReadGeneralCommissioningBasicCommissioningInfo() {} + ~ReadElectricalMeasurementMeasuredPhase5thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000030F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( - CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", [value description]); + [cluster readAttributeMeasuredPhase5thHarmonicCurrentWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase5thHarmonicCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning BasicCommissioningInfo read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement MeasuredPhase5thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27277,40 +30775,40 @@ class ReadGeneralCommissioningBasicCommissioningInfo : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningBasicCommissioningInfo : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasuredPhase5thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningBasicCommissioningInfo() - : SubscribeAttribute("basic-commissioning-info") + SubscribeAttributeElectricalMeasurementMeasuredPhase5thHarmonicCurrent() + : SubscribeAttribute("measured-phase5th-harmonic-current") { } - ~SubscribeAttributeGeneralCommissioningBasicCommissioningInfo() {} + ~SubscribeAttributeElectricalMeasurementMeasuredPhase5thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000030F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeBasicCommissioningInfoWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, - NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeMeasuredPhase5thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase5thHarmonicCurrent " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27322,32 +30820,33 @@ class SubscribeAttributeGeneralCommissioningBasicCommissioningInfo : public Subs }; /* - * Attribute RegulatoryConfig + * Attribute MeasuredPhase7thHarmonicCurrent */ -class ReadGeneralCommissioningRegulatoryConfig : public ReadAttribute { +class ReadElectricalMeasurementMeasuredPhase7thHarmonicCurrent : public ReadAttribute { public: - ReadGeneralCommissioningRegulatoryConfig() - : ReadAttribute("regulatory-config") + ReadElectricalMeasurementMeasuredPhase7thHarmonicCurrent() + : ReadAttribute("measured-phase7th-harmonic-current") { } - ~ReadGeneralCommissioningRegulatoryConfig() {} + ~ReadElectricalMeasurementMeasuredPhase7thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000310) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", [value description]); + [cluster readAttributeMeasuredPhase7thHarmonicCurrentWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase7thHarmonicCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning RegulatoryConfig read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement MeasuredPhase7thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27355,37 +30854,40 @@ class ReadGeneralCommissioningRegulatoryConfig : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningRegulatoryConfig : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasuredPhase7thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningRegulatoryConfig() - : SubscribeAttribute("regulatory-config") + SubscribeAttributeElectricalMeasurementMeasuredPhase7thHarmonicCurrent() + : SubscribeAttribute("measured-phase7th-harmonic-current") { } - ~SubscribeAttributeGeneralCommissioningRegulatoryConfig() {} + ~SubscribeAttributeElectricalMeasurementMeasuredPhase7thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000310) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRegulatoryConfigWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasuredPhase7thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase7thHarmonicCurrent " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27397,32 +30899,33 @@ class SubscribeAttributeGeneralCommissioningRegulatoryConfig : public SubscribeA }; /* - * Attribute LocationCapability + * Attribute MeasuredPhase9thHarmonicCurrent */ -class ReadGeneralCommissioningLocationCapability : public ReadAttribute { +class ReadElectricalMeasurementMeasuredPhase9thHarmonicCurrent : public ReadAttribute { public: - ReadGeneralCommissioningLocationCapability() - : ReadAttribute("location-capability") + ReadElectricalMeasurementMeasuredPhase9thHarmonicCurrent() + : ReadAttribute("measured-phase9th-harmonic-current") { } - ~ReadGeneralCommissioningLocationCapability() {} + ~ReadElectricalMeasurementMeasuredPhase9thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000311) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.LocationCapability response %@", [value description]); + [cluster readAttributeMeasuredPhase9thHarmonicCurrentWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase9thHarmonicCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning LocationCapability read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement MeasuredPhase9thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27430,37 +30933,40 @@ class ReadGeneralCommissioningLocationCapability : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningLocationCapability : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasuredPhase9thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningLocationCapability() - : SubscribeAttribute("location-capability") + SubscribeAttributeElectricalMeasurementMeasuredPhase9thHarmonicCurrent() + : SubscribeAttribute("measured-phase9th-harmonic-current") { } - ~SubscribeAttributeGeneralCommissioningLocationCapability() {} + ~SubscribeAttributeElectricalMeasurementMeasuredPhase9thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000311) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLocationCapabilityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.LocationCapability response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasuredPhase9thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.MeasuredPhase9thHarmonicCurrent " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27472,33 +30978,34 @@ class SubscribeAttributeGeneralCommissioningLocationCapability : public Subscrib }; /* - * Attribute SupportsConcurrentConnection + * Attribute MeasuredPhase11thHarmonicCurrent */ -class ReadGeneralCommissioningSupportsConcurrentConnection : public ReadAttribute { +class ReadElectricalMeasurementMeasuredPhase11thHarmonicCurrent : public ReadAttribute { public: - ReadGeneralCommissioningSupportsConcurrentConnection() - : ReadAttribute("supports-concurrent-connection") + ReadElectricalMeasurementMeasuredPhase11thHarmonicCurrent() + : ReadAttribute("measured-phase11th-harmonic-current") { } - ~ReadGeneralCommissioningSupportsConcurrentConnection() {} + ~ReadElectricalMeasurementMeasuredPhase11thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000312) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSupportsConcurrentConnectionWithCompletionHandler:^( + [cluster readAttributeMeasuredPhase11thHarmonicCurrentWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response %@", [value description]); + NSLog(@"ElectricalMeasurement.MeasuredPhase11thHarmonicCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning SupportsConcurrentConnection read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement MeasuredPhase11thHarmonicCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27506,39 +31013,40 @@ class ReadGeneralCommissioningSupportsConcurrentConnection : public ReadAttribut } }; -class SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementMeasuredPhase11thHarmonicCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection() - : SubscribeAttribute("supports-concurrent-connection") + SubscribeAttributeElectricalMeasurementMeasuredPhase11thHarmonicCurrent() + : SubscribeAttribute("measured-phase11th-harmonic-current") { } - ~SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection() {} + ~SubscribeAttributeElectricalMeasurementMeasuredPhase11thHarmonicCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000312) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeSupportsConcurrentConnectionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response " - @"%@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMeasuredPhase11thHarmonicCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"MeasuredPhase11thHarmonicCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27550,32 +31058,32 @@ class SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection : publi }; /* - * Attribute GeneratedCommandList + * Attribute AcFrequencyMultiplier */ -class ReadGeneralCommissioningGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementAcFrequencyMultiplier : public ReadAttribute { public: - ReadGeneralCommissioningGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementAcFrequencyMultiplier() + : ReadAttribute("ac-frequency-multiplier") { } - ~ReadGeneralCommissioningGeneratedCommandList() {} + ~ReadElectricalMeasurementAcFrequencyMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000400) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); + [cluster readAttributeAcFrequencyMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcFrequencyMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27583,37 +31091,37 @@ class ReadGeneralCommissioningGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcFrequencyMultiplier : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementAcFrequencyMultiplier() + : SubscribeAttribute("ac-frequency-multiplier") { } - ~SubscribeAttributeGeneralCommissioningGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementAcFrequencyMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000400) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcFrequencyMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27625,32 +31133,32 @@ class SubscribeAttributeGeneralCommissioningGeneratedCommandList : public Subscr }; /* - * Attribute AcceptedCommandList + * Attribute AcFrequencyDivisor */ -class ReadGeneralCommissioningAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementAcFrequencyDivisor : public ReadAttribute { public: - ReadGeneralCommissioningAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementAcFrequencyDivisor() + : ReadAttribute("ac-frequency-divisor") { } - ~ReadGeneralCommissioningAcceptedCommandList() {} + ~ReadElectricalMeasurementAcFrequencyDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000401) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); + [cluster readAttributeAcFrequencyDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcFrequencyDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27658,37 +31166,37 @@ class ReadGeneralCommissioningAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcFrequencyDivisor : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementAcFrequencyDivisor() + : SubscribeAttribute("ac-frequency-divisor") { } - ~SubscribeAttributeGeneralCommissioningAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementAcFrequencyDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000401) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcFrequencyDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcFrequencyDivisor response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27700,32 +31208,32 @@ class SubscribeAttributeGeneralCommissioningAcceptedCommandList : public Subscri }; /* - * Attribute AttributeList + * Attribute PowerMultiplier */ -class ReadGeneralCommissioningAttributeList : public ReadAttribute { +class ReadElectricalMeasurementPowerMultiplier : public ReadAttribute { public: - ReadGeneralCommissioningAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementPowerMultiplier() + : ReadAttribute("power-multiplier") { } - ~ReadGeneralCommissioningAttributeList() {} + ~ReadElectricalMeasurementPowerMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000402) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); + [cluster readAttributePowerMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement PowerMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27733,36 +31241,37 @@ class ReadGeneralCommissioningAttributeList : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementPowerMultiplier : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementPowerMultiplier() + : SubscribeAttribute("power-multiplier") { } - ~SubscribeAttributeGeneralCommissioningAttributeList() {} + ~SubscribeAttributeElectricalMeasurementPowerMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000402) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributePowerMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerMultiplier response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27774,32 +31283,32 @@ class SubscribeAttributeGeneralCommissioningAttributeList : public SubscribeAttr }; /* - * Attribute ClusterRevision + * Attribute PowerDivisor */ -class ReadGeneralCommissioningClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementPowerDivisor : public ReadAttribute { public: - ReadGeneralCommissioningClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementPowerDivisor() + : ReadAttribute("power-divisor") { } - ~ReadGeneralCommissioningClusterRevision() {} + ~ReadElectricalMeasurementPowerDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000403) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); + [cluster readAttributePowerDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralCommissioning ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement PowerDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27807,37 +31316,36 @@ class ReadGeneralCommissioningClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeGeneralCommissioningClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementPowerDivisor : public SubscribeAttribute { public: - SubscribeAttributeGeneralCommissioningClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementPowerDivisor() + : SubscribeAttribute("power-divisor") { } - ~SubscribeAttributeGeneralCommissioningClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementPowerDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000403) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePowerDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerDivisor response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27848,98 +31356,73 @@ class SubscribeAttributeGeneralCommissioningClusterRevision : public SubscribeAt } }; -/*----------------------------------------------------------------------------*\ -| Cluster GeneralDiagnostics | 0x0033 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NetworkInterfaces | 0x0000 | -| * RebootCount | 0x0001 | -| * UpTime | 0x0002 | -| * TotalOperationalHours | 0x0003 | -| * BootReasons | 0x0004 | -| * ActiveHardwareFaults | 0x0005 | -| * ActiveRadioFaults | 0x0006 | -| * ActiveNetworkFaults | 0x0007 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * HardwareFaultChange | 0x0000 | -| * RadioFaultChange | 0x0001 | -| * NetworkFaultChange | 0x0002 | -| * BootReason | 0x0003 | -\*----------------------------------------------------------------------------*/ - /* - * Attribute NetworkInterfaces + * Attribute HarmonicCurrentMultiplier */ -class ReadGeneralDiagnosticsNetworkInterfaces : public ReadAttribute { +class ReadElectricalMeasurementHarmonicCurrentMultiplier : public ReadAttribute { public: - ReadGeneralDiagnosticsNetworkInterfaces() - : ReadAttribute("network-interfaces") + ReadElectricalMeasurementHarmonicCurrentMultiplier() + : ReadAttribute("harmonic-current-multiplier") { } - ~ReadGeneralDiagnosticsNetworkInterfaces() {} + ~ReadElectricalMeasurementHarmonicCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000404) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeHarmonicCurrentMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.HarmonicCurrentMultiplier response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics NetworkInterfaces read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement HarmonicCurrentMultiplier read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeGeneralDiagnosticsNetworkInterfaces : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementHarmonicCurrentMultiplier : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsNetworkInterfaces() - : SubscribeAttribute("network-interfaces") + SubscribeAttributeElectricalMeasurementHarmonicCurrentMultiplier() + : SubscribeAttribute("harmonic-current-multiplier") { } - ~SubscribeAttributeGeneralDiagnosticsNetworkInterfaces() {} + ~SubscribeAttributeElectricalMeasurementHarmonicCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000404) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNetworkInterfacesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeHarmonicCurrentMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.HarmonicCurrentMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -27951,32 +31434,33 @@ class SubscribeAttributeGeneralDiagnosticsNetworkInterfaces : public SubscribeAt }; /* - * Attribute RebootCount + * Attribute PhaseHarmonicCurrentMultiplier */ -class ReadGeneralDiagnosticsRebootCount : public ReadAttribute { +class ReadElectricalMeasurementPhaseHarmonicCurrentMultiplier : public ReadAttribute { public: - ReadGeneralDiagnosticsRebootCount() - : ReadAttribute("reboot-count") + ReadElectricalMeasurementPhaseHarmonicCurrentMultiplier() + : ReadAttribute("phase-harmonic-current-multiplier") { } - ~ReadGeneralDiagnosticsRebootCount() {} + ~ReadElectricalMeasurementPhaseHarmonicCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000405) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); + [cluster readAttributePhaseHarmonicCurrentMultiplierWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PhaseHarmonicCurrentMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics RebootCount read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement PhaseHarmonicCurrentMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -27984,36 +31468,40 @@ class ReadGeneralDiagnosticsRebootCount : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsRebootCount : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementPhaseHarmonicCurrentMultiplier : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsRebootCount() - : SubscribeAttribute("reboot-count") + SubscribeAttributeElectricalMeasurementPhaseHarmonicCurrentMultiplier() + : SubscribeAttribute("phase-harmonic-current-multiplier") { } - ~SubscribeAttributeGeneralDiagnosticsRebootCount() {} + ~SubscribeAttributeElectricalMeasurementPhaseHarmonicCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000405) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRebootCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributePhaseHarmonicCurrentMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PhaseHarmonicCurrentMultiplier " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28025,32 +31513,32 @@ class SubscribeAttributeGeneralDiagnosticsRebootCount : public SubscribeAttribut }; /* - * Attribute UpTime + * Attribute InstantaneousVoltage */ -class ReadGeneralDiagnosticsUpTime : public ReadAttribute { +class ReadElectricalMeasurementInstantaneousVoltage : public ReadAttribute { public: - ReadGeneralDiagnosticsUpTime() - : ReadAttribute("up-time") + ReadElectricalMeasurementInstantaneousVoltage() + : ReadAttribute("instantaneous-voltage") { } - ~ReadGeneralDiagnosticsUpTime() {} + ~ReadElectricalMeasurementInstantaneousVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000500) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); + [cluster readAttributeInstantaneousVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics UpTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement InstantaneousVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28058,36 +31546,37 @@ class ReadGeneralDiagnosticsUpTime : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsUpTime : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementInstantaneousVoltage : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsUpTime() - : SubscribeAttribute("up-time") + SubscribeAttributeElectricalMeasurementInstantaneousVoltage() + : SubscribeAttribute("instantaneous-voltage") { } - ~SubscribeAttributeGeneralDiagnosticsUpTime() {} + ~SubscribeAttributeElectricalMeasurementInstantaneousVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000500) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeUpTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeInstantaneousVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28099,70 +31588,72 @@ class SubscribeAttributeGeneralDiagnosticsUpTime : public SubscribeAttribute { }; /* - * Attribute TotalOperationalHours + * Attribute InstantaneousLineCurrent */ -class ReadGeneralDiagnosticsTotalOperationalHours : public ReadAttribute { +class ReadElectricalMeasurementInstantaneousLineCurrent : public ReadAttribute { public: - ReadGeneralDiagnosticsTotalOperationalHours() - : ReadAttribute("total-operational-hours") + ReadElectricalMeasurementInstantaneousLineCurrent() + : ReadAttribute("instantaneous-line-current") { } - ~ReadGeneralDiagnosticsTotalOperationalHours() {} + ~ReadElectricalMeasurementInstantaneousLineCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000501) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeInstantaneousLineCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousLineCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics TotalOperationalHours read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement InstantaneousLineCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeGeneralDiagnosticsTotalOperationalHours : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementInstantaneousLineCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsTotalOperationalHours() - : SubscribeAttribute("total-operational-hours") + SubscribeAttributeElectricalMeasurementInstantaneousLineCurrent() + : SubscribeAttribute("instantaneous-line-current") { } - ~SubscribeAttributeGeneralDiagnosticsTotalOperationalHours() {} + ~SubscribeAttributeElectricalMeasurementInstantaneousLineCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000501) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTotalOperationalHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeInstantaneousLineCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousLineCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28174,69 +31665,72 @@ class SubscribeAttributeGeneralDiagnosticsTotalOperationalHours : public Subscri }; /* - * Attribute BootReasons + * Attribute InstantaneousActiveCurrent */ -class ReadGeneralDiagnosticsBootReasons : public ReadAttribute { +class ReadElectricalMeasurementInstantaneousActiveCurrent : public ReadAttribute { public: - ReadGeneralDiagnosticsBootReasons() - : ReadAttribute("boot-reasons") + ReadElectricalMeasurementInstantaneousActiveCurrent() + : ReadAttribute("instantaneous-active-current") { } - ~ReadGeneralDiagnosticsBootReasons() {} + ~ReadElectricalMeasurementInstantaneousActiveCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000502) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.BootReasons response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeInstantaneousActiveCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousActiveCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics BootReasons read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement InstantaneousActiveCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeGeneralDiagnosticsBootReasons : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementInstantaneousActiveCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsBootReasons() - : SubscribeAttribute("boot-reasons") + SubscribeAttributeElectricalMeasurementInstantaneousActiveCurrent() + : SubscribeAttribute("instantaneous-active-current") { } - ~SubscribeAttributeGeneralDiagnosticsBootReasons() {} + ~SubscribeAttributeElectricalMeasurementInstantaneousActiveCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000502) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBootReasonsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.BootReasons response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeInstantaneousActiveCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousActiveCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28248,32 +31742,33 @@ class SubscribeAttributeGeneralDiagnosticsBootReasons : public SubscribeAttribut }; /* - * Attribute ActiveHardwareFaults + * Attribute InstantaneousReactiveCurrent */ -class ReadGeneralDiagnosticsActiveHardwareFaults : public ReadAttribute { +class ReadElectricalMeasurementInstantaneousReactiveCurrent : public ReadAttribute { public: - ReadGeneralDiagnosticsActiveHardwareFaults() - : ReadAttribute("active-hardware-faults") + ReadElectricalMeasurementInstantaneousReactiveCurrent() + : ReadAttribute("instantaneous-reactive-current") { } - ~ReadGeneralDiagnosticsActiveHardwareFaults() {} + ~ReadElectricalMeasurementInstantaneousReactiveCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000503) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveHardwareFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", [value description]); + [cluster readAttributeInstantaneousReactiveCurrentWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousReactiveCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics ActiveHardwareFaults read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement InstantaneousReactiveCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28281,37 +31776,39 @@ class ReadGeneralDiagnosticsActiveHardwareFaults : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementInstantaneousReactiveCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults() - : SubscribeAttribute("active-hardware-faults") + SubscribeAttributeElectricalMeasurementInstantaneousReactiveCurrent() + : SubscribeAttribute("instantaneous-reactive-current") { } - ~SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults() {} + ~SubscribeAttributeElectricalMeasurementInstantaneousReactiveCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000503) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeActiveHardwareFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeInstantaneousReactiveCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousReactiveCurrent " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28323,32 +31820,32 @@ class SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults : public Subscrib }; /* - * Attribute ActiveRadioFaults + * Attribute InstantaneousPower */ -class ReadGeneralDiagnosticsActiveRadioFaults : public ReadAttribute { +class ReadElectricalMeasurementInstantaneousPower : public ReadAttribute { public: - ReadGeneralDiagnosticsActiveRadioFaults() - : ReadAttribute("active-radio-faults") + ReadElectricalMeasurementInstantaneousPower() + : ReadAttribute("instantaneous-power") { } - ~ReadGeneralDiagnosticsActiveRadioFaults() {} + ~ReadElectricalMeasurementInstantaneousPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000504) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveRadioFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", [value description]); + [cluster readAttributeInstantaneousPowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousPower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics ActiveRadioFaults read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement InstantaneousPower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28356,37 +31853,37 @@ class ReadGeneralDiagnosticsActiveRadioFaults : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsActiveRadioFaults : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementInstantaneousPower : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsActiveRadioFaults() - : SubscribeAttribute("active-radio-faults") + SubscribeAttributeElectricalMeasurementInstantaneousPower() + : SubscribeAttribute("instantaneous-power") { } - ~SubscribeAttributeGeneralDiagnosticsActiveRadioFaults() {} + ~SubscribeAttributeElectricalMeasurementInstantaneousPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000504) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeActiveRadioFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeInstantaneousPowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.InstantaneousPower response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28398,32 +31895,32 @@ class SubscribeAttributeGeneralDiagnosticsActiveRadioFaults : public SubscribeAt }; /* - * Attribute ActiveNetworkFaults + * Attribute RmsVoltage */ -class ReadGeneralDiagnosticsActiveNetworkFaults : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltage : public ReadAttribute { public: - ReadGeneralDiagnosticsActiveNetworkFaults() - : ReadAttribute("active-network-faults") + ReadElectricalMeasurementRmsVoltage() + : ReadAttribute("rms-voltage") { } - ~ReadGeneralDiagnosticsActiveNetworkFaults() {} + ~ReadElectricalMeasurementRmsVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000505) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveNetworkFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", [value description]); + [cluster readAttributeRmsVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics ActiveNetworkFaults read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28431,37 +31928,36 @@ class ReadGeneralDiagnosticsActiveNetworkFaults : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltage : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults() - : SubscribeAttribute("active-network-faults") + SubscribeAttributeElectricalMeasurementRmsVoltage() + : SubscribeAttribute("rms-voltage") { } - ~SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000505) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeActiveNetworkFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28473,32 +31969,32 @@ class SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults : public Subscribe }; /* - * Attribute GeneratedCommandList + * Attribute RmsVoltageMin */ -class ReadGeneralDiagnosticsGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageMin : public ReadAttribute { public: - ReadGeneralDiagnosticsGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementRmsVoltageMin() + : ReadAttribute("rms-voltage-min") { } - ~ReadGeneralDiagnosticsGeneratedCommandList() {} + ~ReadElectricalMeasurementRmsVoltageMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000506) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", [value description]); + [cluster readAttributeRmsVoltageMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMin read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28506,37 +32002,37 @@ class ReadGeneralDiagnosticsGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageMin : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementRmsVoltageMin() + : SubscribeAttribute("rms-voltage-min") { } - ~SubscribeAttributeGeneralDiagnosticsGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000506) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRmsVoltageMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28548,32 +32044,32 @@ class SubscribeAttributeGeneralDiagnosticsGeneratedCommandList : public Subscrib }; /* - * Attribute AcceptedCommandList + * Attribute RmsVoltageMax */ -class ReadGeneralDiagnosticsAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageMax : public ReadAttribute { public: - ReadGeneralDiagnosticsAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementRmsVoltageMax() + : ReadAttribute("rms-voltage-max") { } - ~ReadGeneralDiagnosticsAcceptedCommandList() {} + ~ReadElectricalMeasurementRmsVoltageMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000507) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", [value description]); + [cluster readAttributeRmsVoltageMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28581,37 +32077,37 @@ class ReadGeneralDiagnosticsAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageMax : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementRmsVoltageMax() + : SubscribeAttribute("rms-voltage-max") { } - ~SubscribeAttributeGeneralDiagnosticsAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000507) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRmsVoltageMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28623,32 +32119,32 @@ class SubscribeAttributeGeneralDiagnosticsAcceptedCommandList : public Subscribe }; /* - * Attribute AttributeList + * Attribute RmsCurrent */ -class ReadGeneralDiagnosticsAttributeList : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrent : public ReadAttribute { public: - ReadGeneralDiagnosticsAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementRmsCurrent() + : ReadAttribute("rms-current") { } - ~ReadGeneralDiagnosticsAttributeList() {} + ~ReadElectricalMeasurementRmsCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000508) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); + [cluster readAttributeRmsCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28656,36 +32152,36 @@ class ReadGeneralDiagnosticsAttributeList : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrent : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementRmsCurrent() + : SubscribeAttribute("rms-current") { } - ~SubscribeAttributeGeneralDiagnosticsAttributeList() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000508) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28697,32 +32193,32 @@ class SubscribeAttributeGeneralDiagnosticsAttributeList : public SubscribeAttrib }; /* - * Attribute ClusterRevision + * Attribute RmsCurrentMin */ -class ReadGeneralDiagnosticsClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrentMin : public ReadAttribute { public: - ReadGeneralDiagnosticsClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementRmsCurrentMin() + : ReadAttribute("rms-current-min") { } - ~ReadGeneralDiagnosticsClusterRevision() {} + ~ReadElectricalMeasurementRmsCurrentMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000509) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); + [cluster readAttributeRmsCurrentMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GeneralDiagnostics ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMin read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -28730,37 +32226,37 @@ class ReadGeneralDiagnosticsClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeGeneralDiagnosticsClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrentMin : public SubscribeAttribute { public: - SubscribeAttributeGeneralDiagnosticsClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementRmsCurrentMin() + : SubscribeAttribute("rms-current-min") { } - ~SubscribeAttributeGeneralDiagnosticsClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrentMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000509) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeRmsCurrentMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -28771,396 +32267,141 @@ class SubscribeAttributeGeneralDiagnosticsClusterRevision : public SubscribeAttr } }; -/*----------------------------------------------------------------------------*\ -| Cluster GroupKeyManagement | 0x003F | -|------------------------------------------------------------------------------| -| Commands: | | -| * KeySetWrite | 0x00 | -| * KeySetRead | 0x01 | -| * KeySetRemove | 0x03 | -| * KeySetReadAllIndices | 0x04 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GroupKeyMap | 0x0000 | -| * GroupTable | 0x0001 | -| * MaxGroupsPerFabric | 0x0002 | -| * MaxGroupKeysPerFabric | 0x0003 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command KeySetRead + * Attribute RmsCurrentMax */ -class GroupKeyManagementKeySetRead : public ClusterCommand { +class ReadElectricalMeasurementRmsCurrentMax : public ReadAttribute { public: - GroupKeyManagementKeySetRead() - : ClusterCommand("key-set-read") - { - AddArgument("GroupKeySetID", 0, UINT16_MAX, &mGroupKeySetID); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + ReadElectricalMeasurementRmsCurrentMax() + : ReadAttribute("rms-current-max") { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:mGroupKeySetID]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster keySetReadWithParams:params - completionHandler:^( - CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; } -private: - uint16_t mGroupKeySetID; -}; - -/* - * Command KeySetReadAllIndices - */ -class GroupKeyManagementKeySetReadAllIndices : public ClusterCommand { -public: - GroupKeyManagementKeySetReadAllIndices() - : ClusterCommand("key-set-read-all-indices") - , mComplex_GroupKeySetIDs(&mRequest.groupKeySetIDs) - { - AddArgument("GroupKeySetIDs", &mComplex_GroupKeySetIDs); - ClusterCommand::AddArguments(); - } + ~ReadElectricalMeasurementRmsCurrentMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.groupKeySetIDs) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsCurrentMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMax read Error: %s", chip::ErrorStr(err)); } - params.groupKeySetIDs = array_0; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - keySetReadAllIndicesWithParams:params - completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + SetCommandExitStatus(err); + }]; + return err; } - -private: - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type mRequest; - TypedComplexArgument> mComplex_GroupKeySetIDs; }; -/* - * Command KeySetRemove - */ -class GroupKeyManagementKeySetRemove : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsCurrentMax : public SubscribeAttribute { public: - GroupKeyManagementKeySetRemove() - : ClusterCommand("key-set-remove") + SubscribeAttributeElectricalMeasurementRmsCurrentMax() + : SubscribeAttribute("rms-current-max") { - AddArgument("GroupKeySetID", 0, UINT16_MAX, &mGroupKeySetID); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsCurrentMax() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000003) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupKeySetID = [NSNumber numberWithUnsignedShort:mGroupKeySetID]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster keySetRemoveWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint16_t mGroupKeySetID; -}; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeRmsCurrentMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command KeySetWrite - */ -class GroupKeyManagementKeySetWrite : public ClusterCommand { -public: - GroupKeyManagementKeySetWrite() - : ClusterCommand("key-set-write") - , mComplex_GroupKeySet(&mRequest.groupKeySet) - { - AddArgument("GroupKeySet", &mComplex_GroupKeySet); - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySetStruct new]; - params.groupKeySet.groupKeySetID = [NSNumber numberWithUnsignedShort:mRequest.groupKeySet.groupKeySetID]; - params.groupKeySet.groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.groupKeySet.groupKeySecurityPolicy)]; - if (mRequest.groupKeySet.epochKey0.IsNull()) { - params.groupKeySet.epochKey0 = nil; - } else { - params.groupKeySet.epochKey0 = [NSData dataWithBytes:mRequest.groupKeySet.epochKey0.Value().data() - length:mRequest.groupKeySet.epochKey0.Value().size()]; - } - if (mRequest.groupKeySet.epochStartTime0.IsNull()) { - params.groupKeySet.epochStartTime0 = nil; - } else { - params.groupKeySet.epochStartTime0 = [NSNumber numberWithUnsignedLongLong:mRequest.groupKeySet.epochStartTime0.Value()]; - } - if (mRequest.groupKeySet.epochKey1.IsNull()) { - params.groupKeySet.epochKey1 = nil; - } else { - params.groupKeySet.epochKey1 = [NSData dataWithBytes:mRequest.groupKeySet.epochKey1.Value().data() - length:mRequest.groupKeySet.epochKey1.Value().size()]; - } - if (mRequest.groupKeySet.epochStartTime1.IsNull()) { - params.groupKeySet.epochStartTime1 = nil; - } else { - params.groupKeySet.epochStartTime1 = [NSNumber numberWithUnsignedLongLong:mRequest.groupKeySet.epochStartTime1.Value()]; - } - if (mRequest.groupKeySet.epochKey2.IsNull()) { - params.groupKeySet.epochKey2 = nil; - } else { - params.groupKeySet.epochKey2 = [NSData dataWithBytes:mRequest.groupKeySet.epochKey2.Value().data() - length:mRequest.groupKeySet.epochKey2.Value().size()]; - } - if (mRequest.groupKeySet.epochStartTime2.IsNull()) { - params.groupKeySet.epochStartTime2 = nil; - } else { - params.groupKeySet.epochStartTime2 = [NSNumber numberWithUnsignedLongLong:mRequest.groupKeySet.epochStartTime2.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster keySetWriteWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; - TypedComplexArgument mComplex_GroupKeySet; }; /* - * Attribute GroupKeyMap + * Attribute ActivePower */ -class ReadGroupKeyManagementGroupKeyMap : public ReadAttribute { +class ReadElectricalMeasurementActivePower : public ReadAttribute { public: - ReadGroupKeyManagementGroupKeyMap() - : ReadAttribute("group-key-map") + ReadElectricalMeasurementActivePower() + : ReadAttribute("active-power") { } - ~ReadGroupKeyManagementGroupKeyMap() {} + ~ReadElectricalMeasurementActivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - readAttributeGroupKeyMapWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement GroupKeyMap read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class WriteGroupKeyManagementGroupKeyMap : public WriteAttribute { -public: - WriteGroupKeyManagementGroupKeyMap() - : WriteAttribute("group-key-map") - , mComplex(&mValue) - { - AddArgument("attr-name", "group-key-map"); - AddArgument("attr-value", &mComplex); - WriteAttribute::AddArguments(); - } - - ~WriteGroupKeyManagementGroupKeyMap() {} + [cluster readAttributeActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) WriteAttribute (0x00000000) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - CHIPGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKeyMapStruct new]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement ActivePower read Error: %s", chip::ErrorStr(err)); } - value = array_0; - } - - [cluster writeAttributeGroupKeyMapWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement GroupKeyMap write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + SetCommandExitStatus(err); + }]; + return err; } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument< - chip::app::DataModel::List> - mComplex; }; -class SubscribeAttributeGroupKeyManagementGroupKeyMap : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePower : public SubscribeAttribute { public: - SubscribeAttributeGroupKeyManagementGroupKeyMap() - : SubscribeAttribute("group-key-map") + SubscribeAttributeElectricalMeasurementActivePower() + : SubscribeAttribute("active-power") { } - ~SubscribeAttributeGroupKeyManagementGroupKeyMap() {} + ~SubscribeAttributeElectricalMeasurementActivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGroupKeyMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeActivePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -29176,73 +32417,70 @@ class SubscribeAttributeGroupKeyManagementGroupKeyMap : public SubscribeAttribut }; /* - * Attribute GroupTable + * Attribute ActivePowerMin */ -class ReadGroupKeyManagementGroupTable : public ReadAttribute { +class ReadElectricalMeasurementActivePowerMin : public ReadAttribute { public: - ReadGroupKeyManagementGroupTable() - : ReadAttribute("group-table") + ReadElectricalMeasurementActivePowerMin() + : ReadAttribute("active-power-min") { } - ~ReadGroupKeyManagementGroupTable() {} + ~ReadElectricalMeasurementActivePowerMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - readAttributeGroupTableWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeActivePowerMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement GroupTable read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMin read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeGroupKeyManagementGroupTable : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerMin : public SubscribeAttribute { public: - SubscribeAttributeGroupKeyManagementGroupTable() - : SubscribeAttribute("group-table") + SubscribeAttributeElectricalMeasurementActivePowerMin() + : SubscribeAttribute("active-power-min") { } - ~SubscribeAttributeGroupKeyManagementGroupTable() {} + ~SubscribeAttributeElectricalMeasurementActivePowerMin() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGroupTableWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeActivePowerMinWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29254,32 +32492,32 @@ class SubscribeAttributeGroupKeyManagementGroupTable : public SubscribeAttribute }; /* - * Attribute MaxGroupsPerFabric + * Attribute ActivePowerMax */ -class ReadGroupKeyManagementMaxGroupsPerFabric : public ReadAttribute { +class ReadElectricalMeasurementActivePowerMax : public ReadAttribute { public: - ReadGroupKeyManagementMaxGroupsPerFabric() - : ReadAttribute("max-groups-per-fabric") + ReadElectricalMeasurementActivePowerMax() + : ReadAttribute("active-power-max") { } - ~ReadGroupKeyManagementMaxGroupsPerFabric() {} + ~ReadElectricalMeasurementActivePowerMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", [value description]); + [cluster readAttributeActivePowerMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement MaxGroupsPerFabric read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -29287,37 +32525,37 @@ class ReadGroupKeyManagementMaxGroupsPerFabric : public ReadAttribute { } }; -class SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerMax : public SubscribeAttribute { public: - SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric() - : SubscribeAttribute("max-groups-per-fabric") + SubscribeAttributeElectricalMeasurementActivePowerMax() + : SubscribeAttribute("active-power-max") { } - ~SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric() {} + ~SubscribeAttributeElectricalMeasurementActivePowerMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxGroupsPerFabricWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeActivePowerMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29329,32 +32567,32 @@ class SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric : public SubscribeA }; /* - * Attribute MaxGroupKeysPerFabric + * Attribute ReactivePower */ -class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ReadAttribute { +class ReadElectricalMeasurementReactivePower : public ReadAttribute { public: - ReadGroupKeyManagementMaxGroupKeysPerFabric() - : ReadAttribute("max-group-keys-per-fabric") + ReadElectricalMeasurementReactivePower() + : ReadAttribute("reactive-power") { } - ~ReadGroupKeyManagementMaxGroupKeysPerFabric() {} + ~ReadElectricalMeasurementReactivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", [value description]); + [cluster readAttributeReactivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactivePower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement MaxGroupKeysPerFabric read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ReactivePower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -29362,37 +32600,37 @@ class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ReadAttribute { } }; -class SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementReactivePower : public SubscribeAttribute { public: - SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric() - : SubscribeAttribute("max-group-keys-per-fabric") + SubscribeAttributeElectricalMeasurementReactivePower() + : SubscribeAttribute("reactive-power") { } - ~SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric() {} + ~SubscribeAttributeElectricalMeasurementReactivePower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxGroupKeysPerFabricWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeReactivePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactivePower response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29404,32 +32642,32 @@ class SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric : public Subscri }; /* - * Attribute GeneratedCommandList + * Attribute ApparentPower */ -class ReadGroupKeyManagementGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementApparentPower : public ReadAttribute { public: - ReadGroupKeyManagementGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementApparentPower() + : ReadAttribute("apparent-power") { } - ~ReadGroupKeyManagementGeneratedCommandList() {} + ~ReadElectricalMeasurementApparentPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", [value description]); + [cluster readAttributeApparentPowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ApparentPower response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ApparentPower read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -29437,37 +32675,37 @@ class ReadGroupKeyManagementGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGroupKeyManagementGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementApparentPower : public SubscribeAttribute { public: - SubscribeAttributeGroupKeyManagementGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementApparentPower() + : SubscribeAttribute("apparent-power") { } - ~SubscribeAttributeGroupKeyManagementGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementApparentPower() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeApparentPowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ApparentPower response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29479,32 +32717,32 @@ class SubscribeAttributeGroupKeyManagementGeneratedCommandList : public Subscrib }; /* - * Attribute AcceptedCommandList + * Attribute PowerFactor */ -class ReadGroupKeyManagementAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementPowerFactor : public ReadAttribute { public: - ReadGroupKeyManagementAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementPowerFactor() + : ReadAttribute("power-factor") { } - ~ReadGroupKeyManagementAcceptedCommandList() {} + ~ReadElectricalMeasurementPowerFactor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000510) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", [value description]); + [cluster readAttributePowerFactorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerFactor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement PowerFactor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -29512,37 +32750,36 @@ class ReadGroupKeyManagementAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGroupKeyManagementAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementPowerFactor : public SubscribeAttribute { public: - SubscribeAttributeGroupKeyManagementAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementPowerFactor() + : SubscribeAttribute("power-factor") { } - ~SubscribeAttributeGroupKeyManagementAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementPowerFactor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000510) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePowerFactorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerFactor response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29554,32 +32791,34 @@ class SubscribeAttributeGroupKeyManagementAcceptedCommandList : public Subscribe }; /* - * Attribute AttributeList + * Attribute AverageRmsVoltageMeasurementPeriod */ -class ReadGroupKeyManagementAttributeList : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public ReadAttribute { public: - ReadGroupKeyManagementAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriod() + : ReadAttribute("average-rms-voltage-measurement-period") { } - ~ReadGroupKeyManagementAttributeList() {} + ~ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000511) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); + [cluster readAttributeAverageRmsVoltageMeasurementPeriodWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriod response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsVoltageMeasurementPeriod read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -29587,36 +32826,84 @@ class ReadGroupKeyManagementAttributeList : public ReadAttribute { } }; -class SubscribeAttributeGroupKeyManagementAttributeList : public SubscribeAttribute { +class WriteElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public WriteAttribute { public: - SubscribeAttributeGroupKeyManagementAttributeList() - : SubscribeAttribute("attribute-list") + WriteElectricalMeasurementAverageRmsVoltageMeasurementPeriod() + : WriteAttribute("average-rms-voltage-measurement-period") { + AddArgument("attr-name", "average-rms-voltage-measurement-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeGroupKeyManagementAttributeList() {} + ~WriteElectricalMeasurementAverageRmsVoltageMeasurementPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000511) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "ElectricalMeasurement AverageRmsVoltageMeasurementPeriod " + "write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriod() + : SubscribeAttribute("average-rms-voltage-measurement-period") + { + } + + ~SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriod() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000511) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAverageRmsVoltageMeasurementPeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsVoltageMeasurementPeriod response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29628,32 +32915,33 @@ class SubscribeAttributeGroupKeyManagementAttributeList : public SubscribeAttrib }; /* - * Attribute ClusterRevision + * Attribute AverageRmsUnderVoltageCounter */ -class ReadGroupKeyManagementClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsUnderVoltageCounter : public ReadAttribute { public: - ReadGroupKeyManagementClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementAverageRmsUnderVoltageCounter() + : ReadAttribute("average-rms-under-voltage-counter") { } - ~ReadGroupKeyManagementClusterRevision() {} + ~ReadElectricalMeasurementAverageRmsUnderVoltageCounter() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000513) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); + [cluster readAttributeAverageRmsUnderVoltageCounterWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounter response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "GroupKeyManagement ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AverageRmsUnderVoltageCounter read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -29661,37 +32949,84 @@ class ReadGroupKeyManagementClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeGroupKeyManagementClusterRevision : public SubscribeAttribute { +class WriteElectricalMeasurementAverageRmsUnderVoltageCounter : public WriteAttribute { public: - SubscribeAttributeGroupKeyManagementClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteElectricalMeasurementAverageRmsUnderVoltageCounter() + : WriteAttribute("average-rms-under-voltage-counter") { + AddArgument("attr-name", "average-rms-under-voltage-counter"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeGroupKeyManagementClusterRevision() {} + ~WriteElectricalMeasurementAverageRmsUnderVoltageCounter() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000513) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeAverageRmsUnderVoltageCounterWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "ElectricalMeasurement AverageRmsUnderVoltageCounter write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounter : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounter() + : SubscribeAttribute("average-rms-under-voltage-counter") + { + } + + ~SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounter() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000513) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeAverageRmsUnderVoltageCounterWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounter " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -29702,351 +33037,275 @@ class SubscribeAttributeGroupKeyManagementClusterRevision : public SubscribeAttr } }; -/*----------------------------------------------------------------------------*\ -| Cluster Groups | 0x0004 | -|------------------------------------------------------------------------------| -| Commands: | | -| * AddGroup | 0x00 | -| * ViewGroup | 0x01 | -| * GetGroupMembership | 0x02 | -| * RemoveGroup | 0x03 | -| * RemoveAllGroups | 0x04 | -| * AddGroupIfIdentifying | 0x05 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NameSupport | 0x0000 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command AddGroup + * Attribute RmsExtremeOverVoltagePeriod */ -class GroupsAddGroup : public ClusterCommand { +class ReadElectricalMeasurementRmsExtremeOverVoltagePeriod : public ReadAttribute { public: - GroupsAddGroup() - : ClusterCommand("add-group") + ReadElectricalMeasurementRmsExtremeOverVoltagePeriod() + : ReadAttribute("rms-extreme-over-voltage-period") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("GroupName", &mGroupName); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementRmsExtremeOverVoltagePeriod() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000514) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeRmsExtremeOverVoltagePeriodWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriod response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsExtremeOverVoltagePeriod read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteElectricalMeasurementRmsExtremeOverVoltagePeriod : public WriteAttribute { +public: + WriteElectricalMeasurementRmsExtremeOverVoltagePeriod() + : WriteAttribute("rms-extreme-over-voltage-period") + { + AddArgument("attr-name", "rms-extreme-over-voltage-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteElectricalMeasurementRmsExtremeOverVoltagePeriod() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000514) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.groupName = [[NSString alloc] initWithBytes:mGroupName.data() - length:mGroupName.size() - encoding:NSUTF8StringEncoding]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeRmsExtremeOverVoltagePeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "ElectricalMeasurement RmsExtremeOverVoltagePeriod write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::GroupId mGroupId; - chip::ByteSpan mGroupName; + uint16_t mValue; }; -/* - * Command AddGroupIfIdentifying - */ -class GroupsAddGroupIfIdentifying : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriod : public SubscribeAttribute { public: - GroupsAddGroupIfIdentifying() - : ClusterCommand("add-group-if-identifying") + SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriod() + : SubscribeAttribute("rms-extreme-over-voltage-period") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("GroupName", &mGroupName); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriod() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000005) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000514) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupsClusterAddGroupIfIdentifyingParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.groupName = [[NSString alloc] initWithBytes:mGroupName.data() - length:mGroupName.size() - encoding:NSUTF8StringEncoding]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster addGroupIfIdentifyingWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeRmsExtremeOverVoltagePeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog( + @"ElectricalMeasurement.RmsExtremeOverVoltagePeriod response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::GroupId mGroupId; - chip::ByteSpan mGroupName; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command GetGroupMembership + * Attribute RmsExtremeUnderVoltagePeriod */ -class GroupsGetGroupMembership : public ClusterCommand { +class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriod : public ReadAttribute { public: - GroupsGetGroupMembership() - : ClusterCommand("get-group-membership") - , mComplex_GroupList(&mRequest.groupList) + ReadElectricalMeasurementRmsExtremeUnderVoltagePeriod() + : ReadAttribute("rms-extreme-under-voltage-period") { - AddArgument("GroupList", &mComplex_GroupList); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementRmsExtremeUnderVoltagePeriod() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000515) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.groupList) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - params.groupList = array_0; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster getGroupMembershipWithParams:params - completionHandler:^(CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsExtremeUnderVoltagePeriodWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriod response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::app::Clusters::Groups::Commands::GetGroupMembership::Type mRequest; - TypedComplexArgument> mComplex_GroupList; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsExtremeUnderVoltagePeriod read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command RemoveAllGroups - */ -class GroupsRemoveAllGroups : public ClusterCommand { +class WriteElectricalMeasurementRmsExtremeUnderVoltagePeriod : public WriteAttribute { public: - GroupsRemoveAllGroups() - : ClusterCommand("remove-all-groups") + WriteElectricalMeasurementRmsExtremeUnderVoltagePeriod() + : WriteAttribute("rms-extreme-under-voltage-period") { - ClusterCommand::AddArguments(); + AddArgument("attr-name", "rms-extreme-under-voltage-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } + ~WriteElectricalMeasurementRmsExtremeUnderVoltagePeriod() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000004) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000515) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupsClusterRemoveAllGroupsParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeRmsExtremeUnderVoltagePeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "ElectricalMeasurement RmsExtremeUnderVoltagePeriod write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: + uint16_t mValue; }; -/* - * Command RemoveGroup - */ -class GroupsRemoveGroup : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriod : public SubscribeAttribute { public: - GroupsRemoveGroup() - : ClusterCommand("remove-group") + SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriod() + : SubscribeAttribute("rms-extreme-under-voltage-period") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriod() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000003) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000515) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - chip::GroupId mGroupId; -}; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeRmsExtremeUnderVoltagePeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriod " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command ViewGroup - */ -class GroupsViewGroup : public ClusterCommand { -public: - GroupsViewGroup() - : ClusterCommand("view-group") - { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: - chip::GroupId mGroupId; }; /* - * Attribute NameSupport + * Attribute RmsVoltageSagPeriod */ -class ReadGroupsNameSupport : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSagPeriod : public ReadAttribute { public: - ReadGroupsNameSupport() - : ReadAttribute("name-support") + ReadElectricalMeasurementRmsVoltageSagPeriod() + : ReadAttribute("rms-voltage-sag-period") { } - ~ReadGroupsNameSupport() {} + ~ReadElectricalMeasurementRmsVoltageSagPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000516) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.NameSupport response %@", [value description]); + [cluster readAttributeRmsVoltageSagPeriodWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriod response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Groups NameSupport read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSagPeriod read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30054,34 +33313,80 @@ class ReadGroupsNameSupport : public ReadAttribute { } }; -class SubscribeAttributeGroupsNameSupport : public SubscribeAttribute { +class WriteElectricalMeasurementRmsVoltageSagPeriod : public WriteAttribute { public: - SubscribeAttributeGroupsNameSupport() - : SubscribeAttribute("name-support") + WriteElectricalMeasurementRmsVoltageSagPeriod() + : WriteAttribute("rms-voltage-sag-period") { + AddArgument("attr-name", "rms-voltage-sag-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeGroupsNameSupport() {} + ~WriteElectricalMeasurementRmsVoltageSagPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000516) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeRmsVoltageSagPeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSagPeriod write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriod : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriod() + : SubscribeAttribute("rms-voltage-sag-period") + { + } + + ~SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriod() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000516) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNameSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.NameSupport response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsVoltageSagPeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriod response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30093,30 +33398,32 @@ class SubscribeAttributeGroupsNameSupport : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute RmsVoltageSwellPeriod */ -class ReadGroupsGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSwellPeriod : public ReadAttribute { public: - ReadGroupsGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementRmsVoltageSwellPeriod() + : ReadAttribute("rms-voltage-swell-period") { } - ~ReadGroupsGeneratedCommandList() {} + ~ReadElectricalMeasurementRmsVoltageSwellPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000517) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.GeneratedCommandList response %@", [value description]); + [cluster readAttributeRmsVoltageSwellPeriodWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriod response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Groups GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSwellPeriod read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30124,34 +33431,80 @@ class ReadGroupsGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGroupsGeneratedCommandList : public SubscribeAttribute { +class WriteElectricalMeasurementRmsVoltageSwellPeriod : public WriteAttribute { public: - SubscribeAttributeGroupsGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteElectricalMeasurementRmsVoltageSwellPeriod() + : WriteAttribute("rms-voltage-swell-period") { + AddArgument("attr-name", "rms-voltage-swell-period"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeGroupsGeneratedCommandList() {} + ~WriteElectricalMeasurementRmsVoltageSwellPeriod() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000517) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeRmsVoltageSwellPeriodWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSwellPeriod write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriod : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriod() + : SubscribeAttribute("rms-voltage-swell-period") + { + } + + ~SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriod() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000517) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsVoltageSwellPeriodWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriod response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30163,30 +33516,32 @@ class SubscribeAttributeGroupsGeneratedCommandList : public SubscribeAttribute { }; /* - * Attribute AcceptedCommandList + * Attribute AcVoltageMultiplier */ -class ReadGroupsAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementAcVoltageMultiplier : public ReadAttribute { public: - ReadGroupsAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementAcVoltageMultiplier() + : ReadAttribute("ac-voltage-multiplier") { } - ~ReadGroupsAcceptedCommandList() {} + ~ReadElectricalMeasurementAcVoltageMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000600) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.AcceptedCommandList response %@", [value description]); + [cluster readAttributeAcVoltageMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcVoltageMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Groups AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcVoltageMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30194,30 +33549,33 @@ class ReadGroupsAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeGroupsAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcVoltageMultiplier : public SubscribeAttribute { public: - SubscribeAttributeGroupsAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementAcVoltageMultiplier() + : SubscribeAttribute("ac-voltage-multiplier") { } - ~SubscribeAttributeGroupsAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementAcVoltageMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000600) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeAcVoltageMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.AcceptedCommandList response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcVoltageMultiplier response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -30233,30 +33591,32 @@ class SubscribeAttributeGroupsAcceptedCommandList : public SubscribeAttribute { }; /* - * Attribute AttributeList + * Attribute AcVoltageDivisor */ -class ReadGroupsAttributeList : public ReadAttribute { +class ReadElectricalMeasurementAcVoltageDivisor : public ReadAttribute { public: - ReadGroupsAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementAcVoltageDivisor() + : ReadAttribute("ac-voltage-divisor") { } - ~ReadGroupsAttributeList() {} + ~ReadElectricalMeasurementAcVoltageDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000601) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.AttributeList response %@", [value description]); + [cluster readAttributeAcVoltageDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcVoltageDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Groups AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcVoltageDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30264,34 +33624,37 @@ class ReadGroupsAttributeList : public ReadAttribute { } }; -class SubscribeAttributeGroupsAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcVoltageDivisor : public SubscribeAttribute { public: - SubscribeAttributeGroupsAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementAcVoltageDivisor() + : SubscribeAttribute("ac-voltage-divisor") { } - ~SubscribeAttributeGroupsAttributeList() {} + ~SubscribeAttributeElectricalMeasurementAcVoltageDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000601) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcVoltageDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcVoltageDivisor response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30303,30 +33666,32 @@ class SubscribeAttributeGroupsAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute AcCurrentMultiplier */ -class ReadGroupsClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementAcCurrentMultiplier : public ReadAttribute { public: - ReadGroupsClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementAcCurrentMultiplier() + : ReadAttribute("ac-current-multiplier") { } - ~ReadGroupsClusterRevision() {} + ~ReadElectricalMeasurementAcCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000602) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.ClusterRevision response %@", [value description]); + [cluster readAttributeAcCurrentMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcCurrentMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Groups ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcCurrentMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30334,34 +33699,37 @@ class ReadGroupsClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeGroupsClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcCurrentMultiplier : public SubscribeAttribute { public: - SubscribeAttributeGroupsClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementAcCurrentMultiplier() + : SubscribeAttribute("ac-current-multiplier") { } - ~SubscribeAttributeGroupsClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementAcCurrentMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000602) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Groups.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcCurrentMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcCurrentMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30372,190 +33740,108 @@ class SubscribeAttributeGroupsClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster Identify | 0x0003 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Identify | 0x00 | -| * IdentifyQuery | 0x01 | -| * TriggerEffect | 0x40 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * IdentifyTime | 0x0000 | -| * IdentifyType | 0x0001 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command Identify + * Attribute AcCurrentDivisor */ -class IdentifyIdentify : public ClusterCommand { +class ReadElectricalMeasurementAcCurrentDivisor : public ReadAttribute { public: - IdentifyIdentify() - : ClusterCommand("identify") + ReadElectricalMeasurementAcCurrentDivisor() + : ReadAttribute("ac-current-divisor") { - AddArgument("IdentifyTime", 0, UINT16_MAX, &mIdentifyTime); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementAcCurrentDivisor() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000603) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.identifyTime = [NSNumber numberWithUnsignedShort:mIdentifyTime]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster identifyWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcCurrentDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcCurrentDivisor response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint16_t mIdentifyTime; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement AcCurrentDivisor read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command IdentifyQuery - */ -class IdentifyIdentifyQuery : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementAcCurrentDivisor : public SubscribeAttribute { public: - IdentifyIdentifyQuery() - : ClusterCommand("identify-query") + SubscribeAttributeElectricalMeasurementAcCurrentDivisor() + : SubscribeAttribute("ac-current-divisor") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementAcCurrentDivisor() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000001) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000603) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPIdentifyClusterIdentifyQueryParams 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 identifyQueryWithCompletionHandler:^( - CHIPIdentifyClusterIdentifyQueryResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: -}; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcCurrentDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcCurrentDivisor response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command TriggerEffect - */ -class IdentifyTriggerEffect : public ClusterCommand { -public: - IdentifyTriggerEffect() - : ClusterCommand("trigger-effect") - { - AddArgument("EffectIdentifier", 0, UINT8_MAX, &mEffectIdentifier); - AddArgument("EffectVariant", 0, UINT8_MAX, &mEffectVariant); - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000040) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.effectIdentifier = [NSNumber numberWithUnsignedChar:mEffectIdentifier]; - params.effectVariant = [NSNumber numberWithUnsignedChar:mEffectVariant]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster triggerEffectWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: - uint8_t mEffectIdentifier; - uint8_t mEffectVariant; }; /* - * Attribute IdentifyTime + * Attribute AcPowerMultiplier */ -class ReadIdentifyIdentifyTime : public ReadAttribute { +class ReadElectricalMeasurementAcPowerMultiplier : public ReadAttribute { public: - ReadIdentifyIdentifyTime() - : ReadAttribute("identify-time") + ReadElectricalMeasurementAcPowerMultiplier() + : ReadAttribute("ac-power-multiplier") { } - ~ReadIdentifyIdentifyTime() {} + ~ReadElectricalMeasurementAcPowerMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000604) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.IdentifyTime response %@", [value description]); + [cluster readAttributeAcPowerMultiplierWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcPowerMultiplier response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Identify IdentifyTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcPowerMultiplier read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30563,74 +33849,37 @@ class ReadIdentifyIdentifyTime : public ReadAttribute { } }; -class WriteIdentifyIdentifyTime : public WriteAttribute { -public: - WriteIdentifyIdentifyTime() - : WriteAttribute("identify-time") - { - AddArgument("attr-name", "identify-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteIdentifyIdentifyTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) WriteAttribute (0x00000000) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster - writeAttributeIdentifyTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Identify IdentifyTime write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeIdentifyIdentifyTime : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcPowerMultiplier : public SubscribeAttribute { public: - SubscribeAttributeIdentifyIdentifyTime() - : SubscribeAttribute("identify-time") + SubscribeAttributeElectricalMeasurementAcPowerMultiplier() + : SubscribeAttribute("ac-power-multiplier") { } - ~SubscribeAttributeIdentifyIdentifyTime() {} + ~SubscribeAttributeElectricalMeasurementAcPowerMultiplier() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000604) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeIdentifyTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.IdentifyTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcPowerMultiplierWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcPowerMultiplier response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30642,30 +33891,32 @@ class SubscribeAttributeIdentifyIdentifyTime : public SubscribeAttribute { }; /* - * Attribute IdentifyType + * Attribute AcPowerDivisor */ -class ReadIdentifyIdentifyType : public ReadAttribute { +class ReadElectricalMeasurementAcPowerDivisor : public ReadAttribute { public: - ReadIdentifyIdentifyType() - : ReadAttribute("identify-type") + ReadElectricalMeasurementAcPowerDivisor() + : ReadAttribute("ac-power-divisor") { } - ~ReadIdentifyIdentifyType() {} + ~ReadElectricalMeasurementAcPowerDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000605) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.IdentifyType response %@", [value description]); + [cluster readAttributeAcPowerDivisorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcPowerDivisor response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Identify IdentifyType read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcPowerDivisor read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30673,34 +33924,37 @@ class ReadIdentifyIdentifyType : public ReadAttribute { } }; -class SubscribeAttributeIdentifyIdentifyType : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcPowerDivisor : public SubscribeAttribute { public: - SubscribeAttributeIdentifyIdentifyType() - : SubscribeAttribute("identify-type") + SubscribeAttributeElectricalMeasurementAcPowerDivisor() + : SubscribeAttribute("ac-power-divisor") { } - ~SubscribeAttributeIdentifyIdentifyType() {} + ~SubscribeAttributeElectricalMeasurementAcPowerDivisor() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000605) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeIdentifyTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.IdentifyType response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAcPowerDivisorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcPowerDivisor response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30712,30 +33966,32 @@ class SubscribeAttributeIdentifyIdentifyType : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute OverloadAlarmsMask */ -class ReadIdentifyGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementOverloadAlarmsMask : public ReadAttribute { public: - ReadIdentifyGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementOverloadAlarmsMask() + : ReadAttribute("overload-alarms-mask") { } - ~ReadIdentifyGeneratedCommandList() {} + ~ReadElectricalMeasurementOverloadAlarmsMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000700) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.GeneratedCommandList response %@", [value description]); + [cluster readAttributeOverloadAlarmsMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.OverloadAlarmsMask response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Identify GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement OverloadAlarmsMask read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30743,35 +33999,79 @@ class ReadIdentifyGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeIdentifyGeneratedCommandList : public SubscribeAttribute { +class WriteElectricalMeasurementOverloadAlarmsMask : public WriteAttribute { public: - SubscribeAttributeIdentifyGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteElectricalMeasurementOverloadAlarmsMask() + : WriteAttribute("overload-alarms-mask") { + AddArgument("attr-name", "overload-alarms-mask"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeIdentifyGeneratedCommandList() {} + ~WriteElectricalMeasurementOverloadAlarmsMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000700) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeOverloadAlarmsMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement OverloadAlarmsMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeElectricalMeasurementOverloadAlarmsMask : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementOverloadAlarmsMask() + : SubscribeAttribute("overload-alarms-mask") + { + } + + ~SubscribeAttributeElectricalMeasurementOverloadAlarmsMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000700) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOverloadAlarmsMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.OverloadAlarmsMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30783,30 +34083,32 @@ class SubscribeAttributeIdentifyGeneratedCommandList : public SubscribeAttribute }; /* - * Attribute AcceptedCommandList + * Attribute VoltageOverload */ -class ReadIdentifyAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementVoltageOverload : public ReadAttribute { public: - ReadIdentifyAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementVoltageOverload() + : ReadAttribute("voltage-overload") { } - ~ReadIdentifyAcceptedCommandList() {} + ~ReadElectricalMeasurementVoltageOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000701) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.AcceptedCommandList response %@", [value description]); + [cluster readAttributeVoltageOverloadWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.VoltageOverload response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Identify AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement VoltageOverload read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30814,34 +34116,37 @@ class ReadIdentifyAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeIdentifyAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementVoltageOverload : public SubscribeAttribute { public: - SubscribeAttributeIdentifyAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementVoltageOverload() + : SubscribeAttribute("voltage-overload") { } - ~SubscribeAttributeIdentifyAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementVoltageOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000701) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeVoltageOverloadWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.VoltageOverload response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30853,30 +34158,32 @@ class SubscribeAttributeIdentifyAcceptedCommandList : public SubscribeAttribute }; /* - * Attribute AttributeList + * Attribute CurrentOverload */ -class ReadIdentifyAttributeList : public ReadAttribute { +class ReadElectricalMeasurementCurrentOverload : public ReadAttribute { public: - ReadIdentifyAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementCurrentOverload() + : ReadAttribute("current-overload") { } - ~ReadIdentifyAttributeList() {} + ~ReadElectricalMeasurementCurrentOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000702) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.AttributeList response %@", [value description]); + [cluster readAttributeCurrentOverloadWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.CurrentOverload response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Identify AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement CurrentOverload read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30884,34 +34191,37 @@ class ReadIdentifyAttributeList : public ReadAttribute { } }; -class SubscribeAttributeIdentifyAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementCurrentOverload : public SubscribeAttribute { public: - SubscribeAttributeIdentifyAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementCurrentOverload() + : SubscribeAttribute("current-overload") { } - ~SubscribeAttributeIdentifyAttributeList() {} + ~SubscribeAttributeElectricalMeasurementCurrentOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000702) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeCurrentOverloadWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.CurrentOverload response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30923,30 +34233,32 @@ class SubscribeAttributeIdentifyAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute AcOverloadAlarmsMask */ -class ReadIdentifyClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementAcOverloadAlarmsMask : public ReadAttribute { public: - ReadIdentifyClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementAcOverloadAlarmsMask() + : ReadAttribute("ac-overload-alarms-mask") { } - ~ReadIdentifyClusterRevision() {} + ~ReadElectricalMeasurementAcOverloadAlarmsMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000800) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.ClusterRevision response %@", [value description]); + [cluster readAttributeAcOverloadAlarmsMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcOverloadAlarmsMask response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Identify ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcOverloadAlarmsMask read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -30954,34 +34266,80 @@ class ReadIdentifyClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeIdentifyClusterRevision : public SubscribeAttribute { +class WriteElectricalMeasurementAcOverloadAlarmsMask : public WriteAttribute { public: - SubscribeAttributeIdentifyClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteElectricalMeasurementAcOverloadAlarmsMask() + : WriteAttribute("ac-overload-alarms-mask") { + AddArgument("attr-name", "ac-overload-alarms-mask"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeIdentifyClusterRevision() {} + ~WriteElectricalMeasurementAcOverloadAlarmsMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) WriteAttribute (0x00000800) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeAcOverloadAlarmsMaskWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement AcOverloadAlarmsMask write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeElectricalMeasurementAcOverloadAlarmsMask : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementAcOverloadAlarmsMask() + : SubscribeAttribute("ac-overload-alarms-mask") + { + } + + ~SubscribeAttributeElectricalMeasurementAcOverloadAlarmsMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000800) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Identify.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcOverloadAlarmsMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcOverloadAlarmsMask response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -30992,53 +34350,33 @@ class SubscribeAttributeIdentifyClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster IlluminanceMeasurement | 0x0400 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * LightSensorType | 0x0004 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute MeasuredValue + * Attribute AcVoltageOverload */ -class ReadIlluminanceMeasurementMeasuredValue : public ReadAttribute { +class ReadElectricalMeasurementAcVoltageOverload : public ReadAttribute { public: - ReadIlluminanceMeasurementMeasuredValue() - : ReadAttribute("measured-value") + ReadElectricalMeasurementAcVoltageOverload() + : ReadAttribute("ac-voltage-overload") { } - ~ReadIlluminanceMeasurementMeasuredValue() {} + ~ReadElectricalMeasurementAcVoltageOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000801) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); + [cluster readAttributeAcVoltageOverloadWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcVoltageOverload response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcVoltageOverload read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31046,39 +34384,39 @@ class ReadIlluminanceMeasurementMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcVoltageOverload : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementMeasuredValue() - : SubscribeAttribute("measured-value") + SubscribeAttributeElectricalMeasurementAcVoltageOverload() + : SubscribeAttribute("ac-voltage-overload") { } - ~SubscribeAttributeIlluminanceMeasurementMeasuredValue() {} + ~SubscribeAttributeElectricalMeasurementAcVoltageOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000801) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + [cluster subscribeAttributeAcVoltageOverloadWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcVoltageOverload response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } chip::System::Clock::Timeout GetWaitDuration() const override @@ -31088,32 +34426,32 @@ class SubscribeAttributeIlluminanceMeasurementMeasuredValue : public SubscribeAt }; /* - * Attribute MinMeasuredValue + * Attribute AcCurrentOverload */ -class ReadIlluminanceMeasurementMinMeasuredValue : public ReadAttribute { +class ReadElectricalMeasurementAcCurrentOverload : public ReadAttribute { public: - ReadIlluminanceMeasurementMinMeasuredValue() - : ReadAttribute("min-measured-value") + ReadElectricalMeasurementAcCurrentOverload() + : ReadAttribute("ac-current-overload") { } - ~ReadIlluminanceMeasurementMinMeasuredValue() {} + ~ReadElectricalMeasurementAcCurrentOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000802) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", [value description]); + [cluster readAttributeAcCurrentOverloadWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcCurrentOverload response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcCurrentOverload read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31121,37 +34459,37 @@ class ReadIlluminanceMeasurementMinMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementMinMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcCurrentOverload : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementMinMeasuredValue() - : SubscribeAttribute("min-measured-value") + SubscribeAttributeElectricalMeasurementAcCurrentOverload() + : SubscribeAttribute("ac-current-overload") { } - ~SubscribeAttributeIlluminanceMeasurementMinMeasuredValue() {} + ~SubscribeAttributeElectricalMeasurementAcCurrentOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000802) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcCurrentOverloadWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcCurrentOverload response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31163,32 +34501,32 @@ class SubscribeAttributeIlluminanceMeasurementMinMeasuredValue : public Subscrib }; /* - * Attribute MaxMeasuredValue + * Attribute AcActivePowerOverload */ -class ReadIlluminanceMeasurementMaxMeasuredValue : public ReadAttribute { +class ReadElectricalMeasurementAcActivePowerOverload : public ReadAttribute { public: - ReadIlluminanceMeasurementMaxMeasuredValue() - : ReadAttribute("max-measured-value") + ReadElectricalMeasurementAcActivePowerOverload() + : ReadAttribute("ac-active-power-overload") { } - ~ReadIlluminanceMeasurementMaxMeasuredValue() {} + ~ReadElectricalMeasurementAcActivePowerOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000803) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", [value description]); + [cluster readAttributeAcActivePowerOverloadWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcActivePowerOverload response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AcActivePowerOverload read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31196,37 +34534,37 @@ class ReadIlluminanceMeasurementMaxMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcActivePowerOverload : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue() - : SubscribeAttribute("max-measured-value") + SubscribeAttributeElectricalMeasurementAcActivePowerOverload() + : SubscribeAttribute("ac-active-power-overload") { } - ~SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue() {} + ~SubscribeAttributeElectricalMeasurementAcActivePowerOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000803) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcActivePowerOverloadWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcActivePowerOverload response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31238,69 +34576,71 @@ class SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue : public Subscrib }; /* - * Attribute Tolerance + * Attribute AcReactivePowerOverload */ -class ReadIlluminanceMeasurementTolerance : public ReadAttribute { +class ReadElectricalMeasurementAcReactivePowerOverload : public ReadAttribute { public: - ReadIlluminanceMeasurementTolerance() - : ReadAttribute("tolerance") + ReadElectricalMeasurementAcReactivePowerOverload() + : ReadAttribute("ac-reactive-power-overload") { } - ~ReadIlluminanceMeasurementTolerance() {} + ~ReadElectricalMeasurementAcReactivePowerOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000804) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeAcReactivePowerOverloadWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcReactivePowerOverload response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement AcReactivePowerOverload read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeIlluminanceMeasurementTolerance : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAcReactivePowerOverload : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementTolerance() - : SubscribeAttribute("tolerance") + SubscribeAttributeElectricalMeasurementAcReactivePowerOverload() + : SubscribeAttribute("ac-reactive-power-overload") { } - ~SubscribeAttributeIlluminanceMeasurementTolerance() {} + ~SubscribeAttributeElectricalMeasurementAcReactivePowerOverload() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000804) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcReactivePowerOverloadWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcReactivePowerOverload response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31312,32 +34652,32 @@ class SubscribeAttributeIlluminanceMeasurementTolerance : public SubscribeAttrib }; /* - * Attribute LightSensorType + * Attribute AverageRmsOverVoltage */ -class ReadIlluminanceMeasurementLightSensorType : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsOverVoltage : public ReadAttribute { public: - ReadIlluminanceMeasurementLightSensorType() - : ReadAttribute("light-sensor-type") + ReadElectricalMeasurementAverageRmsOverVoltage() + : ReadAttribute("average-rms-over-voltage") { } - ~ReadIlluminanceMeasurementLightSensorType() {} + ~ReadElectricalMeasurementAverageRmsOverVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000805) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.LightSensorType response %@", [value description]); + [cluster readAttributeAverageRmsOverVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsOverVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement LightSensorType read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AverageRmsOverVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31345,37 +34685,37 @@ class ReadIlluminanceMeasurementLightSensorType : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementLightSensorType : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltage : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementLightSensorType() - : SubscribeAttribute("light-sensor-type") + SubscribeAttributeElectricalMeasurementAverageRmsOverVoltage() + : SubscribeAttribute("average-rms-over-voltage") { } - ~SubscribeAttributeIlluminanceMeasurementLightSensorType() {} + ~SubscribeAttributeElectricalMeasurementAverageRmsOverVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000805) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLightSensorTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.LightSensorType response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAverageRmsOverVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsOverVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31387,32 +34727,32 @@ class SubscribeAttributeIlluminanceMeasurementLightSensorType : public Subscribe }; /* - * Attribute GeneratedCommandList + * Attribute AverageRmsUnderVoltage */ -class ReadIlluminanceMeasurementGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsUnderVoltage : public ReadAttribute { public: - ReadIlluminanceMeasurementGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementAverageRmsUnderVoltage() + : ReadAttribute("average-rms-under-voltage") { } - ~ReadIlluminanceMeasurementGeneratedCommandList() {} + ~ReadElectricalMeasurementAverageRmsUnderVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000806) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", [value description]); + [cluster readAttributeAverageRmsUnderVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement AverageRmsUnderVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31420,37 +34760,37 @@ class ReadIlluminanceMeasurementGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltage : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltage() + : SubscribeAttribute("average-rms-under-voltage") { } - ~SubscribeAttributeIlluminanceMeasurementGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000806) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAverageRmsUnderVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31462,32 +34802,32 @@ class SubscribeAttributeIlluminanceMeasurementGeneratedCommandList : public Subs }; /* - * Attribute AcceptedCommandList + * Attribute RmsExtremeOverVoltage */ -class ReadIlluminanceMeasurementAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsExtremeOverVoltage : public ReadAttribute { public: - ReadIlluminanceMeasurementAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementRmsExtremeOverVoltage() + : ReadAttribute("rms-extreme-over-voltage") { } - ~ReadIlluminanceMeasurementAcceptedCommandList() {} + ~ReadElectricalMeasurementRmsExtremeOverVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000807) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); + [cluster readAttributeRmsExtremeOverVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsExtremeOverVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31495,37 +34835,37 @@ class ReadIlluminanceMeasurementAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltage : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltage() + : SubscribeAttribute("rms-extreme-over-voltage") { } - ~SubscribeAttributeIlluminanceMeasurementAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000807) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsExtremeOverVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31537,32 +34877,32 @@ class SubscribeAttributeIlluminanceMeasurementAcceptedCommandList : public Subsc }; /* - * Attribute AttributeList + * Attribute RmsExtremeUnderVoltage */ -class ReadIlluminanceMeasurementAttributeList : public ReadAttribute { +class ReadElectricalMeasurementRmsExtremeUnderVoltage : public ReadAttribute { public: - ReadIlluminanceMeasurementAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementRmsExtremeUnderVoltage() + : ReadAttribute("rms-extreme-under-voltage") { } - ~ReadIlluminanceMeasurementAttributeList() {} + ~ReadElectricalMeasurementRmsExtremeUnderVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000808) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); + [cluster readAttributeRmsExtremeUnderVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltage response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsExtremeUnderVoltage read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31570,37 +34910,37 @@ class ReadIlluminanceMeasurementAttributeList : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltage : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltage() + : SubscribeAttribute("rms-extreme-under-voltage") { } - ~SubscribeAttributeIlluminanceMeasurementAttributeList() {} + ~SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltage() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000808) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsExtremeUnderVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31612,32 +34952,32 @@ class SubscribeAttributeIlluminanceMeasurementAttributeList : public SubscribeAt }; /* - * Attribute ClusterRevision + * Attribute RmsVoltageSag */ -class ReadIlluminanceMeasurementClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSag : public ReadAttribute { public: - ReadIlluminanceMeasurementClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementRmsVoltageSag() + : ReadAttribute("rms-voltage-sag") { } - ~ReadIlluminanceMeasurementClusterRevision() {} + ~ReadElectricalMeasurementRmsVoltageSag() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000809) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", [value description]); + [cluster readAttributeRmsVoltageSagWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSag response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "IlluminanceMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSag read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31645,37 +34985,37 @@ class ReadIlluminanceMeasurementClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeIlluminanceMeasurementClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageSag : public SubscribeAttribute { public: - SubscribeAttributeIlluminanceMeasurementClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementRmsVoltageSag() + : SubscribeAttribute("rms-voltage-sag") { } - ~SubscribeAttributeIlluminanceMeasurementClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageSag() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000809) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRmsVoltageSagWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSag response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31686,95 +35026,33 @@ class SubscribeAttributeIlluminanceMeasurementClusterRevision : public Subscribe } }; -/*----------------------------------------------------------------------------*\ -| Cluster KeypadInput | 0x0509 | -|------------------------------------------------------------------------------| -| Commands: | | -| * SendKey | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command SendKey - */ -class KeypadInputSendKey : public ClusterCommand { -public: - KeypadInputSendKey() - : ClusterCommand("send-key") - { - AddArgument("KeyCode", 0, UINT8_MAX, &mKeyCode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.keyCode = [NSNumber numberWithUnsignedChar:mKeyCode]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - sendKeyWithParams:params - completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mKeyCode; -}; - /* - * Attribute GeneratedCommandList + * Attribute RmsVoltageSwell */ -class ReadKeypadInputGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSwell : public ReadAttribute { public: - ReadKeypadInputGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementRmsVoltageSwell() + : ReadAttribute("rms-voltage-swell") { } - ~ReadKeypadInputGeneratedCommandList() {} + ~ReadElectricalMeasurementRmsVoltageSwell() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000080A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); + [cluster readAttributeRmsVoltageSwellWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSwell response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "KeypadInput GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSwell read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31782,35 +35060,37 @@ class ReadKeypadInputGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeKeypadInputGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageSwell : public SubscribeAttribute { public: - SubscribeAttributeKeypadInputGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementRmsVoltageSwell() + : SubscribeAttribute("rms-voltage-swell") { } - ~SubscribeAttributeKeypadInputGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageSwell() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000080A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeRmsVoltageSwellWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSwell response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31822,30 +35102,32 @@ class SubscribeAttributeKeypadInputGeneratedCommandList : public SubscribeAttrib }; /* - * Attribute AcceptedCommandList + * Attribute LineCurrentPhaseB */ -class ReadKeypadInputAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementLineCurrentPhaseB : public ReadAttribute { public: - ReadKeypadInputAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementLineCurrentPhaseB() + : ReadAttribute("line-current-phase-b") { } - ~ReadKeypadInputAcceptedCommandList() {} + ~ReadElectricalMeasurementLineCurrentPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000901) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); + [cluster readAttributeLineCurrentPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.LineCurrentPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "KeypadInput AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement LineCurrentPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31853,35 +35135,37 @@ class ReadKeypadInputAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeKeypadInputAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementLineCurrentPhaseB : public SubscribeAttribute { public: - SubscribeAttributeKeypadInputAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementLineCurrentPhaseB() + : SubscribeAttribute("line-current-phase-b") { } - ~SubscribeAttributeKeypadInputAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementLineCurrentPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000901) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLineCurrentPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.LineCurrentPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31893,30 +35177,32 @@ class SubscribeAttributeKeypadInputAcceptedCommandList : public SubscribeAttribu }; /* - * Attribute AttributeList + * Attribute ActiveCurrentPhaseB */ -class ReadKeypadInputAttributeList : public ReadAttribute { +class ReadElectricalMeasurementActiveCurrentPhaseB : public ReadAttribute { public: - ReadKeypadInputAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementActiveCurrentPhaseB() + : ReadAttribute("active-current-phase-b") { } - ~ReadKeypadInputAttributeList() {} + ~ReadElectricalMeasurementActiveCurrentPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000902) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.AttributeList response %@", [value description]); + [cluster readAttributeActiveCurrentPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "KeypadInput AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActiveCurrentPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31924,34 +35210,37 @@ class ReadKeypadInputAttributeList : public ReadAttribute { } }; -class SubscribeAttributeKeypadInputAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActiveCurrentPhaseB : public SubscribeAttribute { public: - SubscribeAttributeKeypadInputAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementActiveCurrentPhaseB() + : SubscribeAttribute("active-current-phase-b") { } - ~SubscribeAttributeKeypadInputAttributeList() {} + ~SubscribeAttributeElectricalMeasurementActiveCurrentPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000902) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActiveCurrentPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -31963,30 +35252,32 @@ class SubscribeAttributeKeypadInputAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute ReactiveCurrentPhaseB */ -class ReadKeypadInputClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementReactiveCurrentPhaseB : public ReadAttribute { public: - ReadKeypadInputClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementReactiveCurrentPhaseB() + : ReadAttribute("reactive-current-phase-b") { } - ~ReadKeypadInputClusterRevision() {} + ~ReadElectricalMeasurementReactiveCurrentPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000903) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); + [cluster readAttributeReactiveCurrentPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "KeypadInput ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ReactiveCurrentPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -31994,34 +35285,37 @@ class ReadKeypadInputClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeKeypadInputClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseB : public SubscribeAttribute { public: - SubscribeAttributeKeypadInputClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseB() + : SubscribeAttribute("reactive-current-phase-b") { } - ~SubscribeAttributeKeypadInputClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000903) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeReactiveCurrentPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32032,477 +35326,333 @@ class SubscribeAttributeKeypadInputClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster LevelControl | 0x0008 | -|------------------------------------------------------------------------------| -| Commands: | | -| * MoveToLevel | 0x00 | -| * Move | 0x01 | -| * Step | 0x02 | -| * Stop | 0x03 | -| * MoveToLevelWithOnOff | 0x04 | -| * MoveWithOnOff | 0x05 | -| * StepWithOnOff | 0x06 | -| * StopWithOnOff | 0x07 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * CurrentLevel | 0x0000 | -| * RemainingTime | 0x0001 | -| * MinLevel | 0x0002 | -| * MaxLevel | 0x0003 | -| * CurrentFrequency | 0x0004 | -| * MinFrequency | 0x0005 | -| * MaxFrequency | 0x0006 | -| * Options | 0x000F | -| * OnOffTransitionTime | 0x0010 | -| * OnLevel | 0x0011 | -| * OnTransitionTime | 0x0012 | -| * OffTransitionTime | 0x0013 | -| * DefaultMoveRate | 0x0014 | -| * StartUpCurrentLevel | 0x4000 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command Move + * Attribute RmsVoltagePhaseB */ -class LevelControlMove : public ClusterCommand { +class ReadElectricalMeasurementRmsVoltagePhaseB : public ReadAttribute { public: - LevelControlMove() - : ClusterCommand("move") + ReadElectricalMeasurementRmsVoltagePhaseB() + : ReadAttribute("rms-voltage-phase-b") { - AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); - AddArgument("Rate", 0, UINT8_MAX, &mRate); - AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementRmsVoltagePhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000905) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; - params.rate = [NSNumber numberWithUnsignedChar:mRate]; - params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; - params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster moveWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsVoltagePhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltagePhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mMoveMode; - uint8_t mRate; - uint8_t mOptionMask; - uint8_t mOptionOverride; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltagePhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command MoveToLevel - */ -class LevelControlMoveToLevel : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsVoltagePhaseB : public SubscribeAttribute { public: - LevelControlMoveToLevel() - : ClusterCommand("move-to-level") + SubscribeAttributeElectricalMeasurementRmsVoltagePhaseB() + : SubscribeAttribute("rms-voltage-phase-b") { - AddArgument("Level", 0, UINT8_MAX, &mLevel); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsVoltagePhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000905) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.level = [NSNumber numberWithUnsignedChar:mLevel]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; - params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeRmsVoltagePhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltagePhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - uint8_t mLevel; - uint16_t mTransitionTime; - uint8_t mOptionMask; - uint8_t mOptionOverride; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command MoveToLevelWithOnOff + * Attribute RmsVoltageMinPhaseB */ -class LevelControlMoveToLevelWithOnOff : public ClusterCommand { +class ReadElectricalMeasurementRmsVoltageMinPhaseB : public ReadAttribute { public: - LevelControlMoveToLevelWithOnOff() - : ClusterCommand("move-to-level-with-on-off") + ReadElectricalMeasurementRmsVoltageMinPhaseB() + : ReadAttribute("rms-voltage-min-phase-b") { - AddArgument("Level", 0, UINT8_MAX, &mLevel); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementRmsVoltageMinPhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000906) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.level = [NSNumber numberWithUnsignedChar:mLevel]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster moveToLevelWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsVoltageMinPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mLevel; - uint16_t mTransitionTime; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMinPhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command MoveWithOnOff - */ -class LevelControlMoveWithOnOff : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseB : public SubscribeAttribute { public: - LevelControlMoveWithOnOff() - : ClusterCommand("move-with-on-off") + SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseB() + : SubscribeAttribute("rms-voltage-min-phase-b") { - AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); - AddArgument("Rate", 0, UINT8_MAX, &mRate); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000005) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000906) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterMoveWithOnOffParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; - params.rate = [NSNumber numberWithUnsignedChar:mRate]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster moveWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeRmsVoltageMinPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - uint8_t mMoveMode; - uint8_t mRate; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command Step + * Attribute RmsVoltageMaxPhaseB */ -class LevelControlStep : public ClusterCommand { +class ReadElectricalMeasurementRmsVoltageMaxPhaseB : public ReadAttribute { public: - LevelControlStep() - : ClusterCommand("step") + ReadElectricalMeasurementRmsVoltageMaxPhaseB() + : ReadAttribute("rms-voltage-max-phase-b") { - AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); - AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementRmsVoltageMaxPhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000907) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; - params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; - params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster stepWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsVoltageMaxPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mStepMode; - uint8_t mStepSize; - uint16_t mTransitionTime; - uint8_t mOptionMask; - uint8_t mOptionOverride; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMaxPhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command StepWithOnOff - */ -class LevelControlStepWithOnOff : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseB : public SubscribeAttribute { public: - LevelControlStepWithOnOff() - : ClusterCommand("step-with-on-off") + SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseB() + : SubscribeAttribute("rms-voltage-max-phase-b") { - AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); - AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000006) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000907) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterStepWithOnOffParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; - params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster stepWithOnOffWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeRmsVoltageMaxPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - uint8_t mStepMode; - uint8_t mStepSize; - uint16_t mTransitionTime; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command Stop + * Attribute RmsCurrentPhaseB */ -class LevelControlStop : public ClusterCommand { +class ReadElectricalMeasurementRmsCurrentPhaseB : public ReadAttribute { public: - LevelControlStop() - : ClusterCommand("stop") + ReadElectricalMeasurementRmsCurrentPhaseB() + : ReadAttribute("rms-current-phase-b") { - AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementRmsCurrentPhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000908) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterStopParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; - params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster stopWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsCurrentPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentPhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mOptionMask; - uint8_t mOptionOverride; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentPhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command StopWithOnOff - */ -class LevelControlStopWithOnOff : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementRmsCurrentPhaseB : public SubscribeAttribute { public: - LevelControlStopWithOnOff() - : ClusterCommand("stop-with-on-off") + SubscribeAttributeElectricalMeasurementRmsCurrentPhaseB() + : SubscribeAttribute("rms-current-phase-b") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementRmsCurrentPhaseB() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000007) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000908) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLevelControlClusterStopWithOnOffParams 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 stopWithOnOffWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeRmsCurrentPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Attribute CurrentLevel + * Attribute RmsCurrentMinPhaseB */ -class ReadLevelControlCurrentLevel : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrentMinPhaseB : public ReadAttribute { public: - ReadLevelControlCurrentLevel() - : ReadAttribute("current-level") + ReadElectricalMeasurementRmsCurrentMinPhaseB() + : ReadAttribute("rms-current-min-phase-b") { } - ~ReadLevelControlCurrentLevel() {} + ~ReadElectricalMeasurementRmsCurrentMinPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000909) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.CurrentLevel response %@", [value description]); + [cluster readAttributeRmsCurrentMinPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl CurrentLevel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMinPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32510,34 +35660,37 @@ class ReadLevelControlCurrentLevel : public ReadAttribute { } }; -class SubscribeAttributeLevelControlCurrentLevel : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlCurrentLevel() - : SubscribeAttribute("current-level") + SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseB() + : SubscribeAttribute("rms-current-min-phase-b") { } - ~SubscribeAttributeLevelControlCurrentLevel() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000909) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.CurrentLevel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsCurrentMinPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32549,30 +35702,32 @@ class SubscribeAttributeLevelControlCurrentLevel : public SubscribeAttribute { }; /* - * Attribute RemainingTime + * Attribute RmsCurrentMaxPhaseB */ -class ReadLevelControlRemainingTime : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrentMaxPhaseB : public ReadAttribute { public: - ReadLevelControlRemainingTime() - : ReadAttribute("remaining-time") + ReadElectricalMeasurementRmsCurrentMaxPhaseB() + : ReadAttribute("rms-current-max-phase-b") { } - ~ReadLevelControlRemainingTime() {} + ~ReadElectricalMeasurementRmsCurrentMaxPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000090A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.RemainingTime response %@", [value description]); + [cluster readAttributeRmsCurrentMaxPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl RemainingTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMaxPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32580,34 +35735,37 @@ class ReadLevelControlRemainingTime : public ReadAttribute { } }; -class SubscribeAttributeLevelControlRemainingTime : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlRemainingTime() - : SubscribeAttribute("remaining-time") + SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseB() + : SubscribeAttribute("rms-current-max-phase-b") { } - ~SubscribeAttributeLevelControlRemainingTime() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000090A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRemainingTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.RemainingTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsCurrentMaxPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32619,30 +35777,32 @@ class SubscribeAttributeLevelControlRemainingTime : public SubscribeAttribute { }; /* - * Attribute MinLevel + * Attribute ActivePowerPhaseB */ -class ReadLevelControlMinLevel : public ReadAttribute { +class ReadElectricalMeasurementActivePowerPhaseB : public ReadAttribute { public: - ReadLevelControlMinLevel() - : ReadAttribute("min-level") + ReadElectricalMeasurementActivePowerPhaseB() + : ReadAttribute("active-power-phase-b") { } - ~ReadLevelControlMinLevel() {} + ~ReadElectricalMeasurementActivePowerPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000090B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MinLevel response %@", [value description]); + [cluster readAttributeActivePowerPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl MinLevel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32650,34 +35810,37 @@ class ReadLevelControlMinLevel : public ReadAttribute { } }; -class SubscribeAttributeLevelControlMinLevel : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlMinLevel() - : SubscribeAttribute("min-level") + SubscribeAttributeElectricalMeasurementActivePowerPhaseB() + : SubscribeAttribute("active-power-phase-b") { } - ~SubscribeAttributeLevelControlMinLevel() {} + ~SubscribeAttributeElectricalMeasurementActivePowerPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000090B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MinLevel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActivePowerPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32689,30 +35852,32 @@ class SubscribeAttributeLevelControlMinLevel : public SubscribeAttribute { }; /* - * Attribute MaxLevel + * Attribute ActivePowerMinPhaseB */ -class ReadLevelControlMaxLevel : public ReadAttribute { +class ReadElectricalMeasurementActivePowerMinPhaseB : public ReadAttribute { public: - ReadLevelControlMaxLevel() - : ReadAttribute("max-level") + ReadElectricalMeasurementActivePowerMinPhaseB() + : ReadAttribute("active-power-min-phase-b") { } - ~ReadLevelControlMaxLevel() {} + ~ReadElectricalMeasurementActivePowerMinPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000090C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MaxLevel response %@", [value description]); + [cluster readAttributeActivePowerMinPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl MaxLevel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMinPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32720,34 +35885,37 @@ class ReadLevelControlMaxLevel : public ReadAttribute { } }; -class SubscribeAttributeLevelControlMaxLevel : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerMinPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlMaxLevel() - : SubscribeAttribute("max-level") + SubscribeAttributeElectricalMeasurementActivePowerMinPhaseB() + : SubscribeAttribute("active-power-min-phase-b") { } - ~SubscribeAttributeLevelControlMaxLevel() {} + ~SubscribeAttributeElectricalMeasurementActivePowerMinPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000090C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MaxLevel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActivePowerMinPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32759,30 +35927,32 @@ class SubscribeAttributeLevelControlMaxLevel : public SubscribeAttribute { }; /* - * Attribute CurrentFrequency + * Attribute ActivePowerMaxPhaseB */ -class ReadLevelControlCurrentFrequency : public ReadAttribute { +class ReadElectricalMeasurementActivePowerMaxPhaseB : public ReadAttribute { public: - ReadLevelControlCurrentFrequency() - : ReadAttribute("current-frequency") + ReadElectricalMeasurementActivePowerMaxPhaseB() + : ReadAttribute("active-power-max-phase-b") { } - ~ReadLevelControlCurrentFrequency() {} + ~ReadElectricalMeasurementActivePowerMaxPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000090D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); + [cluster readAttributeActivePowerMaxPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl CurrentFrequency read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMaxPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32790,34 +35960,37 @@ class ReadLevelControlCurrentFrequency : public ReadAttribute { } }; -class SubscribeAttributeLevelControlCurrentFrequency : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlCurrentFrequency() - : SubscribeAttribute("current-frequency") + SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseB() + : SubscribeAttribute("active-power-max-phase-b") { } - ~SubscribeAttributeLevelControlCurrentFrequency() {} + ~SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000090D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActivePowerMaxPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32829,30 +36002,32 @@ class SubscribeAttributeLevelControlCurrentFrequency : public SubscribeAttribute }; /* - * Attribute MinFrequency + * Attribute ReactivePowerPhaseB */ -class ReadLevelControlMinFrequency : public ReadAttribute { +class ReadElectricalMeasurementReactivePowerPhaseB : public ReadAttribute { public: - ReadLevelControlMinFrequency() - : ReadAttribute("min-frequency") + ReadElectricalMeasurementReactivePowerPhaseB() + : ReadAttribute("reactive-power-phase-b") { } - ~ReadLevelControlMinFrequency() {} + ~ReadElectricalMeasurementReactivePowerPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000090E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MinFrequency response %@", [value description]); + [cluster readAttributeReactivePowerPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactivePowerPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl MinFrequency read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ReactivePowerPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32860,34 +36035,37 @@ class ReadLevelControlMinFrequency : public ReadAttribute { } }; -class SubscribeAttributeLevelControlMinFrequency : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementReactivePowerPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlMinFrequency() - : SubscribeAttribute("min-frequency") + SubscribeAttributeElectricalMeasurementReactivePowerPhaseB() + : SubscribeAttribute("reactive-power-phase-b") { } - ~SubscribeAttributeLevelControlMinFrequency() {} + ~SubscribeAttributeElectricalMeasurementReactivePowerPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000090E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MinFrequency response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeReactivePowerPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactivePowerPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32899,30 +36077,32 @@ class SubscribeAttributeLevelControlMinFrequency : public SubscribeAttribute { }; /* - * Attribute MaxFrequency + * Attribute ApparentPowerPhaseB */ -class ReadLevelControlMaxFrequency : public ReadAttribute { +class ReadElectricalMeasurementApparentPowerPhaseB : public ReadAttribute { public: - ReadLevelControlMaxFrequency() - : ReadAttribute("max-frequency") + ReadElectricalMeasurementApparentPowerPhaseB() + : ReadAttribute("apparent-power-phase-b") { } - ~ReadLevelControlMaxFrequency() {} + ~ReadElectricalMeasurementApparentPowerPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000090F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MaxFrequency response %@", [value description]); + [cluster readAttributeApparentPowerPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ApparentPowerPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl MaxFrequency read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ApparentPowerPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -32930,34 +36110,37 @@ class ReadLevelControlMaxFrequency : public ReadAttribute { } }; -class SubscribeAttributeLevelControlMaxFrequency : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementApparentPowerPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlMaxFrequency() - : SubscribeAttribute("max-frequency") + SubscribeAttributeElectricalMeasurementApparentPowerPhaseB() + : SubscribeAttribute("apparent-power-phase-b") { } - ~SubscribeAttributeLevelControlMaxFrequency() {} + ~SubscribeAttributeElectricalMeasurementApparentPowerPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000090F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.MaxFrequency response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeApparentPowerPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ApparentPowerPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -32969,30 +36152,32 @@ class SubscribeAttributeLevelControlMaxFrequency : public SubscribeAttribute { }; /* - * Attribute Options + * Attribute PowerFactorPhaseB */ -class ReadLevelControlOptions : public ReadAttribute { +class ReadElectricalMeasurementPowerFactorPhaseB : public ReadAttribute { public: - ReadLevelControlOptions() - : ReadAttribute("options") + ReadElectricalMeasurementPowerFactorPhaseB() + : ReadAttribute("power-factor-phase-b") { } - ~ReadLevelControlOptions() {} + ~ReadElectricalMeasurementPowerFactorPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000910) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.Options response %@", [value description]); + [cluster readAttributePowerFactorPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerFactorPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl Options read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement PowerFactorPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33000,73 +36185,119 @@ class ReadLevelControlOptions : public ReadAttribute { } }; -class WriteLevelControlOptions : public WriteAttribute { +class SubscribeAttributeElectricalMeasurementPowerFactorPhaseB : public SubscribeAttribute { public: - WriteLevelControlOptions() - : WriteAttribute("options") + SubscribeAttributeElectricalMeasurementPowerFactorPhaseB() + : SubscribeAttribute("power-factor-phase-b") { - AddArgument("attr-name", "options"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); } - ~WriteLevelControlOptions() {} + ~SubscribeAttributeElectricalMeasurementPowerFactorPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000910) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePowerFactorPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerFactorPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeOptionsWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl Options write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - uint8_t mValue; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; -class SubscribeAttributeLevelControlOptions : public SubscribeAttribute { +/* + * Attribute AverageRmsVoltageMeasurementPeriodPhaseB + */ +class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB : public ReadAttribute { public: - SubscribeAttributeLevelControlOptions() - : SubscribeAttribute("options") + ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB() + : ReadAttribute("average-rms-voltage-measurement-period-phase-b") { } - ~SubscribeAttributeLevelControlOptions() {} + ~ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000911) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsVoltageMeasurementPeriodPhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB() + : SubscribeAttribute("average-rms-voltage-measurement-period-phase-b") + { + } + + ~SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000911) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOptionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.Options response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsVoltageMeasurementPeriodPhaseB " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33078,30 +36309,34 @@ class SubscribeAttributeLevelControlOptions : public SubscribeAttribute { }; /* - * Attribute OnOffTransitionTime + * Attribute AverageRmsOverVoltageCounterPhaseB */ -class ReadLevelControlOnOffTransitionTime : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseB : public ReadAttribute { public: - ReadLevelControlOnOffTransitionTime() - : ReadAttribute("on-off-transition-time") + ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseB() + : ReadAttribute("average-rms-over-voltage-counter-phase-b") { } - ~ReadLevelControlOnOffTransitionTime() {} + ~ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000912) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); + [cluster readAttributeAverageRmsOverVoltageCounterPhaseBWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl OnOffTransitionTime read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsOverVoltageCounterPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33109,75 +36344,40 @@ class ReadLevelControlOnOffTransitionTime : public ReadAttribute { } }; -class WriteLevelControlOnOffTransitionTime : public WriteAttribute { +class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseB : public SubscribeAttribute { public: - WriteLevelControlOnOffTransitionTime() - : WriteAttribute("on-off-transition-time") + SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseB() + : SubscribeAttribute("average-rms-over-voltage-counter-phase-b") { - AddArgument("attr-name", "on-off-transition-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); } - ~WriteLevelControlOnOffTransitionTime() {} + ~SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000912) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster writeAttributeOnOffTransitionTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl OnOffTransitionTime write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeLevelControlOnOffTransitionTime : public SubscribeAttribute { -public: - SubscribeAttributeLevelControlOnOffTransitionTime() - : SubscribeAttribute("on-off-transition-time") - { - } - - ~SubscribeAttributeLevelControlOnOffTransitionTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000010) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeOnOffTransitionTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAverageRmsOverVoltageCounterPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsOverVoltageCounterPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33189,30 +36389,34 @@ class SubscribeAttributeLevelControlOnOffTransitionTime : public SubscribeAttrib }; /* - * Attribute OnLevel + * Attribute AverageRmsUnderVoltageCounterPhaseB */ -class ReadLevelControlOnLevel : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB : public ReadAttribute { public: - ReadLevelControlOnLevel() - : ReadAttribute("on-level") + ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB() + : ReadAttribute("average-rms-under-voltage-counter-phase-b") { } - ~ReadLevelControlOnLevel() {} + ~ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000913) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OnLevel response %@", [value description]); + [cluster readAttributeAverageRmsUnderVoltageCounterPhaseBWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl OnLevel read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsUnderVoltageCounterPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33220,73 +36424,41 @@ class ReadLevelControlOnLevel : public ReadAttribute { } }; -class WriteLevelControlOnLevel : public WriteAttribute { -public: - WriteLevelControlOnLevel() - : WriteAttribute("on-level") - { - AddArgument("attr-name", "on-level"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteLevelControlOnLevel() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000011) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeOnLevelWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl OnLevel write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlOnLevel() - : SubscribeAttribute("on-level") + SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB() + : SubscribeAttribute("average-rms-under-voltage-counter-phase-b") { } - ~SubscribeAttributeLevelControlOnLevel() {} + ~SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000913) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOnLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OnLevel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAverageRmsUnderVoltageCounterPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsUnderVoltageCounterPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33298,30 +36470,34 @@ class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { }; /* - * Attribute OnTransitionTime + * Attribute RmsExtremeOverVoltagePeriodPhaseB */ -class ReadLevelControlOnTransitionTime : public ReadAttribute { +class ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB : public ReadAttribute { public: - ReadLevelControlOnTransitionTime() - : ReadAttribute("on-transition-time") + ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB() + : ReadAttribute("rms-extreme-over-voltage-period-phase-b") { } - ~ReadLevelControlOnTransitionTime() {} + ~ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000914) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); + [cluster readAttributeRmsExtremeOverVoltagePeriodPhaseBWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl OnTransitionTime read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement RmsExtremeOverVoltagePeriodPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33329,74 +36505,40 @@ class ReadLevelControlOnTransitionTime : public ReadAttribute { } }; -class WriteLevelControlOnTransitionTime : public WriteAttribute { -public: - WriteLevelControlOnTransitionTime() - : WriteAttribute("on-transition-time") - { - AddArgument("attr-name", "on-transition-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteLevelControlOnTransitionTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000012) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster writeAttributeOnTransitionTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl OnTransitionTime write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlOnTransitionTime() - : SubscribeAttribute("on-transition-time") + SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB() + : SubscribeAttribute("rms-extreme-over-voltage-period-phase-b") { } - ~SubscribeAttributeLevelControlOnTransitionTime() {} + ~SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000914) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOnTransitionTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsExtremeOverVoltagePeriodPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"RmsExtremeOverVoltagePeriodPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33408,30 +36550,34 @@ class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute }; /* - * Attribute OffTransitionTime + * Attribute RmsExtremeUnderVoltagePeriodPhaseB */ -class ReadLevelControlOffTransitionTime : public ReadAttribute { +class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB : public ReadAttribute { public: - ReadLevelControlOffTransitionTime() - : ReadAttribute("off-transition-time") + ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB() + : ReadAttribute("rms-extreme-under-voltage-period-phase-b") { } - ~ReadLevelControlOffTransitionTime() {} + ~ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000915) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); + [cluster readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseB response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl OffTransitionTime read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement RmsExtremeUnderVoltagePeriodPhaseB read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33439,74 +36585,40 @@ class ReadLevelControlOffTransitionTime : public ReadAttribute { } }; -class WriteLevelControlOffTransitionTime : public WriteAttribute { -public: - WriteLevelControlOffTransitionTime() - : WriteAttribute("off-transition-time") - { - AddArgument("attr-name", "off-transition-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteLevelControlOffTransitionTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000013) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster writeAttributeOffTransitionTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl OffTransitionTime write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB : public SubscribeAttribute { public: - SubscribeAttributeLevelControlOffTransitionTime() - : SubscribeAttribute("off-transition-time") + SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB() + : SubscribeAttribute("rms-extreme-under-voltage-period-phase-b") { } - ~SubscribeAttributeLevelControlOffTransitionTime() {} + ~SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000915) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOffTransitionTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsExtremeUnderVoltagePeriodPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"RmsExtremeUnderVoltagePeriodPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33518,105 +36630,150 @@ class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribut }; /* - * Attribute DefaultMoveRate + * Attribute RmsVoltageSagPeriodPhaseB */ -class ReadLevelControlDefaultMoveRate : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSagPeriodPhaseB : public ReadAttribute { public: - ReadLevelControlDefaultMoveRate() - : ReadAttribute("default-move-rate") + ReadElectricalMeasurementRmsVoltageSagPeriodPhaseB() + : ReadAttribute("rms-voltage-sag-period-phase-b") { } - ~ReadLevelControlDefaultMoveRate() {} + ~ReadElectricalMeasurementRmsVoltageSagPeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000916) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeRmsVoltageSagPeriodPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl DefaultMoveRate read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSagPeriodPhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteLevelControlDefaultMoveRate : public WriteAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseB : public SubscribeAttribute { public: - WriteLevelControlDefaultMoveRate() - : WriteAttribute("default-move-rate") + SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseB() + : SubscribeAttribute("rms-voltage-sag-period-phase-b") { - AddArgument("attr-name", "default-move-rate"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); } - ~WriteLevelControlDefaultMoveRate() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000916) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeRmsVoltageSagPeriodPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeDefaultMoveRateWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl DefaultMoveRate write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - uint8_t mValue; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; -class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute { +/* + * Attribute RmsVoltageSwellPeriodPhaseB + */ +class ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseB : public ReadAttribute { public: - SubscribeAttributeLevelControlDefaultMoveRate() - : SubscribeAttribute("default-move-rate") + ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseB() + : ReadAttribute("rms-voltage-swell-period-phase-b") { } - ~SubscribeAttributeLevelControlDefaultMoveRate() {} + ~ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseB() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000917) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeRmsVoltageSwellPeriodPhaseBWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseB response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSwellPeriodPhaseB read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseB : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseB() + : SubscribeAttribute("rms-voltage-swell-period-phase-b") + { + } + + ~SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseB() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000917) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDefaultMoveRateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRmsVoltageSwellPeriodPhaseBWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog( + @"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseB response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33628,30 +36785,32 @@ class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute }; /* - * Attribute StartUpCurrentLevel + * Attribute LineCurrentPhaseC */ -class ReadLevelControlStartUpCurrentLevel : public ReadAttribute { +class ReadElectricalMeasurementLineCurrentPhaseC : public ReadAttribute { public: - ReadLevelControlStartUpCurrentLevel() - : ReadAttribute("start-up-current-level") + ReadElectricalMeasurementLineCurrentPhaseC() + : ReadAttribute("line-current-phase-c") { } - ~ReadLevelControlStartUpCurrentLevel() {} + ~ReadElectricalMeasurementLineCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A01) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); + [cluster readAttributeLineCurrentPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.LineCurrentPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl StartUpCurrentLevel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement LineCurrentPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33659,75 +36818,37 @@ class ReadLevelControlStartUpCurrentLevel : public ReadAttribute { } }; -class WriteLevelControlStartUpCurrentLevel : public WriteAttribute { -public: - WriteLevelControlStartUpCurrentLevel() - : WriteAttribute("start-up-current-level") - { - AddArgument("attr-name", "start-up-current-level"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteLevelControlStartUpCurrentLevel() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00004000) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeStartUpCurrentLevelWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LevelControl StartUpCurrentLevel write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementLineCurrentPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLevelControlStartUpCurrentLevel() - : SubscribeAttribute("start-up-current-level") + SubscribeAttributeElectricalMeasurementLineCurrentPhaseC() + : SubscribeAttribute("line-current-phase-c") { } - ~SubscribeAttributeLevelControlStartUpCurrentLevel() {} + ~SubscribeAttributeElectricalMeasurementLineCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A01) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeStartUpCurrentLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLineCurrentPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.LineCurrentPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33739,30 +36860,32 @@ class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttrib }; /* - * Attribute GeneratedCommandList + * Attribute ActiveCurrentPhaseC */ -class ReadLevelControlGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementActiveCurrentPhaseC : public ReadAttribute { public: - ReadLevelControlGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementActiveCurrentPhaseC() + : ReadAttribute("active-current-phase-c") { } - ~ReadLevelControlGeneratedCommandList() {} + ~ReadElectricalMeasurementActiveCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A02) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.GeneratedCommandList response %@", [value description]); + [cluster readAttributeActiveCurrentPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActiveCurrentPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33770,35 +36893,37 @@ class ReadLevelControlGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeLevelControlGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActiveCurrentPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLevelControlGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementActiveCurrentPhaseC() + : SubscribeAttribute("active-current-phase-c") { } - ~SubscribeAttributeLevelControlGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementActiveCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A02) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActiveCurrentPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33810,30 +36935,32 @@ class SubscribeAttributeLevelControlGeneratedCommandList : public SubscribeAttri }; /* - * Attribute AcceptedCommandList + * Attribute ReactiveCurrentPhaseC */ -class ReadLevelControlAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementReactiveCurrentPhaseC : public ReadAttribute { public: - ReadLevelControlAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementReactiveCurrentPhaseC() + : ReadAttribute("reactive-current-phase-c") { } - ~ReadLevelControlAcceptedCommandList() {} + ~ReadElectricalMeasurementReactiveCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A03) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); + [cluster readAttributeReactiveCurrentPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ReactiveCurrentPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33841,35 +36968,37 @@ class ReadLevelControlAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeLevelControlAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLevelControlAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseC() + : SubscribeAttribute("reactive-current-phase-c") { } - ~SubscribeAttributeLevelControlAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A03) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeReactiveCurrentPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33881,30 +37010,32 @@ class SubscribeAttributeLevelControlAcceptedCommandList : public SubscribeAttrib }; /* - * Attribute AttributeList + * Attribute RmsVoltagePhaseC */ -class ReadLevelControlAttributeList : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltagePhaseC : public ReadAttribute { public: - ReadLevelControlAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementRmsVoltagePhaseC() + : ReadAttribute("rms-voltage-phase-c") { } - ~ReadLevelControlAttributeList() {} + ~ReadElectricalMeasurementRmsVoltagePhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A05) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.AttributeList response %@", [value description]); + [cluster readAttributeRmsVoltagePhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltagePhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltagePhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33912,34 +37043,37 @@ class ReadLevelControlAttributeList : public ReadAttribute { } }; -class SubscribeAttributeLevelControlAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltagePhaseC : public SubscribeAttribute { public: - SubscribeAttributeLevelControlAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementRmsVoltagePhaseC() + : SubscribeAttribute("rms-voltage-phase-c") { } - ~SubscribeAttributeLevelControlAttributeList() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltagePhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A05) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsVoltagePhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltagePhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -33951,30 +37085,32 @@ class SubscribeAttributeLevelControlAttributeList : public SubscribeAttribute { }; /* - * Attribute FeatureMap + * Attribute RmsVoltageMinPhaseC */ -class ReadLevelControlFeatureMap : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageMinPhaseC : public ReadAttribute { public: - ReadLevelControlFeatureMap() - : ReadAttribute("feature-map") + ReadElectricalMeasurementRmsVoltageMinPhaseC() + : ReadAttribute("rms-voltage-min-phase-c") { } - ~ReadLevelControlFeatureMap() {} + ~ReadElectricalMeasurementRmsVoltageMinPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A06) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.FeatureMap response %@", [value description]); + [cluster readAttributeRmsVoltageMinPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMinPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -33982,34 +37118,37 @@ class ReadLevelControlFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeLevelControlFeatureMap : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLevelControlFeatureMap() - : SubscribeAttribute("feature-map") + SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseC() + : SubscribeAttribute("rms-voltage-min-phase-c") { } - ~SubscribeAttributeLevelControlFeatureMap() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A06) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.FeatureMap response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsVoltageMinPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34021,30 +37160,32 @@ class SubscribeAttributeLevelControlFeatureMap : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute RmsVoltageMaxPhaseC */ -class ReadLevelControlClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageMaxPhaseC : public ReadAttribute { public: - ReadLevelControlClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementRmsVoltageMaxPhaseC() + : ReadAttribute("rms-voltage-max-phase-c") { } - ~ReadLevelControlClusterRevision() {} + ~ReadElectricalMeasurementRmsVoltageMaxPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A07) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.ClusterRevision response %@", [value description]); + [cluster readAttributeRmsVoltageMaxPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LevelControl ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageMaxPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34052,34 +37193,37 @@ class ReadLevelControlClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeLevelControlClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLevelControlClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseC() + : SubscribeAttribute("rms-voltage-max-phase-c") { } - ~SubscribeAttributeLevelControlClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A07) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LevelControl.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsVoltageMaxPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34090,50 +37234,33 @@ class SubscribeAttributeLevelControlClusterRevision : public SubscribeAttribute } }; -/*----------------------------------------------------------------------------*\ -| Cluster LocalizationConfiguration | 0x002B | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ActiveLocale | 0x0001 | -| * SupportedLocales | 0x0002 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute ActiveLocale + * Attribute RmsCurrentPhaseC */ -class ReadLocalizationConfigurationActiveLocale : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrentPhaseC : public ReadAttribute { public: - ReadLocalizationConfigurationActiveLocale() - : ReadAttribute("active-locale") + ReadElectricalMeasurementRmsCurrentPhaseC() + : ReadAttribute("rms-current-phase-c") { } - ~ReadLocalizationConfigurationActiveLocale() {} + ~ReadElectricalMeasurementRmsCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A08) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveLocaleWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); + [cluster readAttributeRmsCurrentPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LocalizationConfiguration ActiveLocale read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34141,81 +37268,37 @@ class ReadLocalizationConfigurationActiveLocale : public ReadAttribute { } }; -class WriteLocalizationConfigurationActiveLocale : public WriteAttribute { -public: - WriteLocalizationConfigurationActiveLocale() - : WriteAttribute("active-locale") - { - AddArgument("attr-name", "active-locale"); - AddArgument("attr-value", &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteLocalizationConfigurationActiveLocale() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) WriteAttribute (0x00000001) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; - - [cluster writeAttributeActiveLocaleWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "LocalizationConfiguration ActiveLocale write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - chip::ByteSpan mValue; -}; - -class SubscribeAttributeLocalizationConfigurationActiveLocale : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrentPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLocalizationConfigurationActiveLocale() - : SubscribeAttribute("active-locale") + SubscribeAttributeElectricalMeasurementRmsCurrentPhaseC() + : SubscribeAttribute("rms-current-phase-c") { } - ~SubscribeAttributeLocalizationConfigurationActiveLocale() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrentPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A08) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeActiveLocaleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsCurrentPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34227,32 +37310,32 @@ class SubscribeAttributeLocalizationConfigurationActiveLocale : public Subscribe }; /* - * Attribute SupportedLocales + * Attribute RmsCurrentMinPhaseC */ -class ReadLocalizationConfigurationSupportedLocales : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrentMinPhaseC : public ReadAttribute { public: - ReadLocalizationConfigurationSupportedLocales() - : ReadAttribute("supported-locales") + ReadElectricalMeasurementRmsCurrentMinPhaseC() + : ReadAttribute("rms-current-min-phase-c") { } - ~ReadLocalizationConfigurationSupportedLocales() {} + ~ReadElectricalMeasurementRmsCurrentMinPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A09) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSupportedLocalesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.SupportedLocales response %@", [value description]); + [cluster readAttributeRmsCurrentMinPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LocalizationConfiguration SupportedLocales read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMinPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34260,37 +37343,37 @@ class ReadLocalizationConfigurationSupportedLocales : public ReadAttribute { } }; -class SubscribeAttributeLocalizationConfigurationSupportedLocales : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLocalizationConfigurationSupportedLocales() - : SubscribeAttribute("supported-locales") + SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseC() + : SubscribeAttribute("rms-current-min-phase-c") { } - ~SubscribeAttributeLocalizationConfigurationSupportedLocales() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A09) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSupportedLocalesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.SupportedLocales response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsCurrentMinPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34302,32 +37385,32 @@ class SubscribeAttributeLocalizationConfigurationSupportedLocales : public Subsc }; /* - * Attribute GeneratedCommandList + * Attribute RmsCurrentMaxPhaseC */ -class ReadLocalizationConfigurationGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsCurrentMaxPhaseC : public ReadAttribute { public: - ReadLocalizationConfigurationGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementRmsCurrentMaxPhaseC() + : ReadAttribute("rms-current-max-phase-c") { } - ~ReadLocalizationConfigurationGeneratedCommandList() {} + ~ReadElectricalMeasurementRmsCurrentMaxPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A0A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", [value description]); + [cluster readAttributeRmsCurrentMaxPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LocalizationConfiguration GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement RmsCurrentMaxPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34335,37 +37418,37 @@ class ReadLocalizationConfigurationGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeLocalizationConfigurationGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLocalizationConfigurationGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseC() + : SubscribeAttribute("rms-current-max-phase-c") { } - ~SubscribeAttributeLocalizationConfigurationGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A0A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsCurrentMaxPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34377,32 +37460,32 @@ class SubscribeAttributeLocalizationConfigurationGeneratedCommandList : public S }; /* - * Attribute AcceptedCommandList + * Attribute ActivePowerPhaseC */ -class ReadLocalizationConfigurationAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementActivePowerPhaseC : public ReadAttribute { public: - ReadLocalizationConfigurationAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementActivePowerPhaseC() + : ReadAttribute("active-power-phase-c") { } - ~ReadLocalizationConfigurationAcceptedCommandList() {} + ~ReadElectricalMeasurementActivePowerPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A0B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", [value description]); + [cluster readAttributeActivePowerPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LocalizationConfiguration AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34410,37 +37493,37 @@ class ReadLocalizationConfigurationAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeLocalizationConfigurationAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLocalizationConfigurationAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementActivePowerPhaseC() + : SubscribeAttribute("active-power-phase-c") { } - ~SubscribeAttributeLocalizationConfigurationAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementActivePowerPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A0B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActivePowerPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34452,32 +37535,32 @@ class SubscribeAttributeLocalizationConfigurationAcceptedCommandList : public Su }; /* - * Attribute ClusterRevision + * Attribute ActivePowerMinPhaseC */ -class ReadLocalizationConfigurationClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementActivePowerMinPhaseC : public ReadAttribute { public: - ReadLocalizationConfigurationClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementActivePowerMinPhaseC() + : ReadAttribute("active-power-min-phase-c") { } - ~ReadLocalizationConfigurationClusterRevision() {} + ~ReadElectricalMeasurementActivePowerMinPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A0C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.ClusterRevision response %@", [value description]); + [cluster readAttributeActivePowerMinPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LocalizationConfiguration ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMinPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34485,37 +37568,37 @@ class ReadLocalizationConfigurationClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeLocalizationConfigurationClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerMinPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLocalizationConfigurationClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementActivePowerMinPhaseC() + : SubscribeAttribute("active-power-min-phase-c") { } - ~SubscribeAttributeLocalizationConfigurationClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementActivePowerMinPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A0C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LocalizationConfiguration.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActivePowerMinPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34526,89 +37609,33 @@ class SubscribeAttributeLocalizationConfigurationClusterRevision : public Subscr } }; -/*----------------------------------------------------------------------------*\ -| Cluster LowPower | 0x0508 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Sleep | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command Sleep + * Attribute ActivePowerMaxPhaseC */ -class LowPowerSleep : public ClusterCommand { +class ReadElectricalMeasurementActivePowerMaxPhaseC : public ReadAttribute { public: - LowPowerSleep() - : ClusterCommand("sleep") + ReadElectricalMeasurementActivePowerMaxPhaseC() + : ReadAttribute("active-power-max-phase-c") { - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementActivePowerMaxPhaseC() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A0D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPLowPowerClusterSleepParams 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 sleepWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: -}; - -/* - * Attribute GeneratedCommandList - */ -class ReadLowPowerGeneratedCommandList : public ReadAttribute { -public: - ReadLowPowerGeneratedCommandList() - : ReadAttribute("generated-command-list") - { - } - - ~ReadLowPowerGeneratedCommandList() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); + [cluster readAttributeActivePowerMaxPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LowPower GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ActivePowerMaxPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34616,35 +37643,37 @@ class ReadLowPowerGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeLowPowerGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLowPowerGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseC() + : SubscribeAttribute("active-power-max-phase-c") { } - ~SubscribeAttributeLowPowerGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A0D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActivePowerMaxPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34656,30 +37685,32 @@ class SubscribeAttributeLowPowerGeneratedCommandList : public SubscribeAttribute }; /* - * Attribute AcceptedCommandList + * Attribute ReactivePowerPhaseC */ -class ReadLowPowerAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementReactivePowerPhaseC : public ReadAttribute { public: - ReadLowPowerAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementReactivePowerPhaseC() + : ReadAttribute("reactive-power-phase-c") { } - ~ReadLowPowerAcceptedCommandList() {} + ~ReadElectricalMeasurementReactivePowerPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A0E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); + [cluster readAttributeReactivePowerPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactivePowerPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LowPower AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ReactivePowerPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34687,30 +37718,33 @@ class ReadLowPowerAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeLowPowerAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementReactivePowerPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLowPowerAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementReactivePowerPhaseC() + : SubscribeAttribute("reactive-power-phase-c") { } - ~SubscribeAttributeLowPowerAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementReactivePowerPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A0E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeReactivePowerPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ReactivePowerPhaseC response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -34726,30 +37760,32 @@ class SubscribeAttributeLowPowerAcceptedCommandList : public SubscribeAttribute }; /* - * Attribute AttributeList + * Attribute ApparentPowerPhaseC */ -class ReadLowPowerAttributeList : public ReadAttribute { +class ReadElectricalMeasurementApparentPowerPhaseC : public ReadAttribute { public: - ReadLowPowerAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementApparentPowerPhaseC() + : ReadAttribute("apparent-power-phase-c") { } - ~ReadLowPowerAttributeList() {} + ~ReadElectricalMeasurementApparentPowerPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A0F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.AttributeList response %@", [value description]); + [cluster readAttributeApparentPowerPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ApparentPowerPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LowPower AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement ApparentPowerPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34757,34 +37793,37 @@ class ReadLowPowerAttributeList : public ReadAttribute { } }; -class SubscribeAttributeLowPowerAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementApparentPowerPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLowPowerAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementApparentPowerPhaseC() + : SubscribeAttribute("apparent-power-phase-c") { } - ~SubscribeAttributeLowPowerAttributeList() {} + ~SubscribeAttributeElectricalMeasurementApparentPowerPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A0F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeApparentPowerPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ApparentPowerPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34796,30 +37835,32 @@ class SubscribeAttributeLowPowerAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute PowerFactorPhaseC */ -class ReadLowPowerClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementPowerFactorPhaseC : public ReadAttribute { public: - ReadLowPowerClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementPowerFactorPhaseC() + : ReadAttribute("power-factor-phase-c") { } - ~ReadLowPowerClusterRevision() {} + ~ReadElectricalMeasurementPowerFactorPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A10) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.ClusterRevision response %@", [value description]); + [cluster readAttributePowerFactorPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerFactorPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "LowPower ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ElectricalMeasurement PowerFactorPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -34827,34 +37868,37 @@ class ReadLowPowerClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeLowPowerClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementPowerFactorPhaseC : public SubscribeAttribute { public: - SubscribeAttributeLowPowerClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementPowerFactorPhaseC() + : SubscribeAttribute("power-factor-phase-c") { } - ~SubscribeAttributeLowPowerClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementPowerFactorPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A10) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"LowPower.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePowerFactorPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.PowerFactorPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -34865,231 +37909,117 @@ class SubscribeAttributeLowPowerClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster MediaInput | 0x0507 | -|------------------------------------------------------------------------------| -| Commands: | | -| * SelectInput | 0x00 | -| * ShowInputStatus | 0x01 | -| * HideInputStatus | 0x02 | -| * RenameInput | 0x03 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * InputList | 0x0000 | -| * CurrentInput | 0x0001 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command HideInputStatus + * Attribute AverageRmsVoltageMeasurementPeriodPhaseC */ -class MediaInputHideInputStatus : public ClusterCommand { +class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC : public ReadAttribute { public: - MediaInputHideInputStatus() - : ClusterCommand("hide-input-status") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC() + : ReadAttribute("average-rms-voltage-measurement-period-phase-c") { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaInputClusterHideInputStatusParams 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 hideInputStatusWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; } -private: -}; - -/* - * Command RenameInput - */ -class MediaInputRenameInput : public ClusterCommand { -public: - MediaInputRenameInput() - : ClusterCommand("rename-input") - { - AddArgument("Index", 0, UINT8_MAX, &mIndex); - AddArgument("Name", &mName); - ClusterCommand::AddArguments(); - } + ~ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A11) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaInputClusterRenameInputParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.index = [NSNumber numberWithUnsignedChar:mIndex]; - params.name = [[NSString alloc] initWithBytes:mName.data() length:mName.size() encoding:NSUTF8StringEncoding]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster renameInputWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseC response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mIndex; - chip::ByteSpan mName; + if (error != nil) { + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsVoltageMeasurementPeriodPhaseC read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command SelectInput - */ -class MediaInputSelectInput : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC : public SubscribeAttribute { public: - MediaInputSelectInput() - : ClusterCommand("select-input") + SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC() + : SubscribeAttribute("average-rms-voltage-measurement-period-phase-c") { - AddArgument("Index", 0, UINT8_MAX, &mIndex); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A11) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaInputClusterSelectInputParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.index = [NSNumber numberWithUnsignedChar:mIndex]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster selectInputWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mIndex; -}; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsVoltageMeasurementPeriodPhaseC " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command ShowInputStatus - */ -class MediaInputShowInputStatus : public ClusterCommand { -public: - MediaInputShowInputStatus() - : ClusterCommand("show-input-status") - { - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaInputClusterShowInputStatusParams 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 showInputStatusWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: }; /* - * Attribute InputList + * Attribute AverageRmsOverVoltageCounterPhaseC */ -class ReadMediaInputInputList : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseC : public ReadAttribute { public: - ReadMediaInputInputList() - : ReadAttribute("input-list") + ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseC() + : ReadAttribute("average-rms-over-voltage-counter-phase-c") { } - ~ReadMediaInputInputList() {} + ~ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A12) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.InputList response %@", [value description]); + [cluster readAttributeAverageRmsOverVoltageCounterPhaseCWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaInput InputList read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsOverVoltageCounterPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -35097,34 +38027,40 @@ class ReadMediaInputInputList : public ReadAttribute { } }; -class SubscribeAttributeMediaInputInputList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseC : public SubscribeAttribute { public: - SubscribeAttributeMediaInputInputList() - : SubscribeAttribute("input-list") + SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseC() + : SubscribeAttribute("average-rms-over-voltage-counter-phase-c") { } - ~SubscribeAttributeMediaInputInputList() {} + ~SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A12) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInputListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.InputList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAverageRmsOverVoltageCounterPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsOverVoltageCounterPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -35136,30 +38072,34 @@ class SubscribeAttributeMediaInputInputList : public SubscribeAttribute { }; /* - * Attribute CurrentInput + * Attribute AverageRmsUnderVoltageCounterPhaseC */ -class ReadMediaInputCurrentInput : public ReadAttribute { +class ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC : public ReadAttribute { public: - ReadMediaInputCurrentInput() - : ReadAttribute("current-input") + ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC() + : ReadAttribute("average-rms-under-voltage-counter-phase-c") { } - ~ReadMediaInputCurrentInput() {} + ~ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A13) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.CurrentInput response %@", [value description]); + [cluster readAttributeAverageRmsUnderVoltageCounterPhaseCWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaInput CurrentInput read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement AverageRmsUnderVoltageCounterPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -35167,34 +38107,41 @@ class ReadMediaInputCurrentInput : public ReadAttribute { } }; -class SubscribeAttributeMediaInputCurrentInput : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC : public SubscribeAttribute { public: - SubscribeAttributeMediaInputCurrentInput() - : SubscribeAttribute("current-input") + SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC() + : SubscribeAttribute("average-rms-under-voltage-counter-phase-c") { } - ~SubscribeAttributeMediaInputCurrentInput() {} + ~SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A13) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentInputWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.CurrentInput response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAverageRmsUnderVoltageCounterPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"AverageRmsUnderVoltageCounterPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -35206,30 +38153,34 @@ class SubscribeAttributeMediaInputCurrentInput : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute RmsExtremeOverVoltagePeriodPhaseC */ -class ReadMediaInputGeneratedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC : public ReadAttribute { public: - ReadMediaInputGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC() + : ReadAttribute("rms-extreme-over-voltage-period-phase-c") { } - ~ReadMediaInputGeneratedCommandList() {} + ~ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A14) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); + [cluster readAttributeRmsExtremeOverVoltagePeriodPhaseCWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaInput GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement RmsExtremeOverVoltagePeriodPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -35237,35 +38188,40 @@ class ReadMediaInputGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeMediaInputGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC : public SubscribeAttribute { public: - SubscribeAttributeMediaInputGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC() + : SubscribeAttribute("rms-extreme-over-voltage-period-phase-c") { } - ~SubscribeAttributeMediaInputGeneratedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A14) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsExtremeOverVoltagePeriodPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"RmsExtremeOverVoltagePeriodPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -35277,30 +38233,34 @@ class SubscribeAttributeMediaInputGeneratedCommandList : public SubscribeAttribu }; /* - * Attribute AcceptedCommandList + * Attribute RmsExtremeUnderVoltagePeriodPhaseC */ -class ReadMediaInputAcceptedCommandList : public ReadAttribute { +class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC : public ReadAttribute { public: - ReadMediaInputAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC() + : ReadAttribute("rms-extreme-under-voltage-period-phase-c") { } - ~ReadMediaInputAcceptedCommandList() {} + ~ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A15) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseC response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaInput AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "ElectricalMeasurement RmsExtremeUnderVoltagePeriodPhaseC read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -35308,35 +38268,40 @@ class ReadMediaInputAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeMediaInputAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC : public SubscribeAttribute { public: - SubscribeAttributeMediaInputAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC() + : SubscribeAttribute("rms-extreme-under-voltage-period-phase-c") { } - ~SubscribeAttributeMediaInputAcceptedCommandList() {} + ~SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A15) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRmsExtremeUnderVoltagePeriodPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement." + @"RmsExtremeUnderVoltagePeriodPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -35348,65 +38313,72 @@ class SubscribeAttributeMediaInputAcceptedCommandList : public SubscribeAttribut }; /* - * Attribute AttributeList + * Attribute RmsVoltageSagPeriodPhaseC */ -class ReadMediaInputAttributeList : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSagPeriodPhaseC : public ReadAttribute { public: - ReadMediaInputAttributeList() - : ReadAttribute("attribute-list") + ReadElectricalMeasurementRmsVoltageSagPeriodPhaseC() + : ReadAttribute("rms-voltage-sag-period-phase-c") { } - ~ReadMediaInputAttributeList() {} + ~ReadElectricalMeasurementRmsVoltageSagPeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A16) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.AttributeList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeRmsVoltageSagPeriodPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseC response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "MediaInput AttributeList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSagPeriodPhaseC read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeMediaInputAttributeList : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseC : public SubscribeAttribute { public: - SubscribeAttributeMediaInputAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseC() + : SubscribeAttribute("rms-voltage-sag-period-phase-c") { } - ~SubscribeAttributeMediaInputAttributeList() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A16) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRmsVoltageSagPeriodPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -35418,65 +38390,73 @@ class SubscribeAttributeMediaInputAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute RmsVoltageSwellPeriodPhaseC */ -class ReadMediaInputClusterRevision : public ReadAttribute { +class ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseC : public ReadAttribute { public: - ReadMediaInputClusterRevision() - : ReadAttribute("cluster-revision") + ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseC() + : ReadAttribute("rms-voltage-swell-period-phase-c") { } - ~ReadMediaInputClusterRevision() {} + ~ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000A17) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.ClusterRevision response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeRmsVoltageSwellPeriodPhaseCWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseC response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "MediaInput ClusterRevision read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement RmsVoltageSwellPeriodPhaseC read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeMediaInputClusterRevision : public SubscribeAttribute { +class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseC : public SubscribeAttribute { public: - SubscribeAttributeMediaInputClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseC() + : SubscribeAttribute("rms-voltage-swell-period-phase-c") { } - ~SubscribeAttributeMediaInputClusterRevision() {} + ~SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseC() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000A17) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaInput.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRmsVoltageSwellPeriodPhaseCWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog( + @"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseC response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -35487,518 +38467,433 @@ class SubscribeAttributeMediaInputClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster MediaPlayback | 0x0506 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Play | 0x00 | -| * Pause | 0x01 | -| * StopPlayback | 0x02 | -| * StartOver | 0x03 | -| * Previous | 0x04 | -| * Next | 0x05 | -| * Rewind | 0x06 | -| * FastForward | 0x07 | -| * SkipForward | 0x08 | -| * SkipBackward | 0x09 | -| * Seek | 0x0B | -|------------------------------------------------------------------------------| -| Attributes: | | -| * CurrentState | 0x0000 | -| * StartTime | 0x0001 | -| * Duration | 0x0002 | -| * SampledPosition | 0x0003 | -| * PlaybackSpeed | 0x0004 | -| * SeekRangeEnd | 0x0005 | -| * SeekRangeStart | 0x0006 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command FastForward + * Attribute GeneratedCommandList */ -class MediaPlaybackFastForward : public ClusterCommand { +class ReadElectricalMeasurementGeneratedCommandList : public ReadAttribute { public: - MediaPlaybackFastForward() - : ClusterCommand("fast-forward") + ReadElectricalMeasurementGeneratedCommandList() + : ReadAttribute("generated-command-list") { - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterFastForwardParams 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 fastForwardWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command Next - */ -class MediaPlaybackNext : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementGeneratedCommandList : public SubscribeAttribute { public: - MediaPlaybackNext() - : ClusterCommand("next") + SubscribeAttributeElectricalMeasurementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000005) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterNextParams 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 nextWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command Pause + * Attribute AcceptedCommandList */ -class MediaPlaybackPause : public ClusterCommand { +class ReadElectricalMeasurementAcceptedCommandList : public ReadAttribute { public: - MediaPlaybackPause() - : ClusterCommand("pause") + ReadElectricalMeasurementAcceptedCommandList() + : ReadAttribute("accepted-command-list") { - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementAcceptedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterPauseParams 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 pauseWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command Play - */ -class MediaPlaybackPlay : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementAcceptedCommandList : public SubscribeAttribute { public: - MediaPlaybackPlay() - : ClusterCommand("play") + SubscribeAttributeElectricalMeasurementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementAcceptedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterPlayParams 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 playWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command Previous + * Attribute AttributeList */ -class MediaPlaybackPrevious : public ClusterCommand { +class ReadElectricalMeasurementAttributeList : public ReadAttribute { public: - MediaPlaybackPrevious() - : ClusterCommand("previous") + ReadElectricalMeasurementAttributeList() + : ReadAttribute("attribute-list") { - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementAttributeList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterPreviousParams 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 previousWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } +}; -private: +class SubscribeAttributeElectricalMeasurementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeElectricalMeasurementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeElectricalMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command Rewind + * Attribute FeatureMap */ -class MediaPlaybackRewind : public ClusterCommand { +class ReadElectricalMeasurementFeatureMap : public ReadAttribute { public: - MediaPlaybackRewind() - : ClusterCommand("rewind") + ReadElectricalMeasurementFeatureMap() + : ReadAttribute("feature-map") { - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementFeatureMap() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterRewindParams 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 rewindWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command Seek - */ -class MediaPlaybackSeek : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementFeatureMap : public SubscribeAttribute { public: - MediaPlaybackSeek() - : ClusterCommand("seek") + SubscribeAttributeElectricalMeasurementFeatureMap() + : SubscribeAttribute("feature-map") { - AddArgument("Position", 0, UINT64_MAX, &mPosition); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementFeatureMap() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x0000000B) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterSeekParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.position = [NSNumber numberWithUnsignedLongLong:mPosition]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - seekWithParams:params - completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint64_t mPosition; -}; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command SkipBackward - */ -class MediaPlaybackSkipBackward : public ClusterCommand { -public: - MediaPlaybackSkipBackward() - : ClusterCommand("skip-backward") - { - AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds); - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000009) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterSkipBackwardParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:mDeltaPositionMilliseconds]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster skipBackwardWithParams:params - completionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: - uint64_t mDeltaPositionMilliseconds; }; /* - * Command SkipForward + * Attribute ClusterRevision */ -class MediaPlaybackSkipForward : public ClusterCommand { +class ReadElectricalMeasurementClusterRevision : public ReadAttribute { public: - MediaPlaybackSkipForward() - : ClusterCommand("skip-forward") + ReadElectricalMeasurementClusterRevision() + : ReadAttribute("cluster-revision") { - AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds); - ClusterCommand::AddArguments(); } + ~ReadElectricalMeasurementClusterRevision() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterSkipForwardParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:mDeltaPositionMilliseconds]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster skipForwardWithParams:params - completionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint64_t mDeltaPositionMilliseconds; + if (error != nil) { + ChipLogError(chipTool, "ElectricalMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command StartOver - */ -class MediaPlaybackStartOver : public ClusterCommand { +class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeAttribute { public: - MediaPlaybackStartOver() - : ClusterCommand("start-over") + SubscribeAttributeElectricalMeasurementClusterRevision() + : SubscribeAttribute("cluster-revision") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeElectricalMeasurementClusterRevision() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000003) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterStartOverParams 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 startOverWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; +/*----------------------------------------------------------------------------*\ +| Cluster EthernetNetworkDiagnostics | 0x0037 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ResetCounts | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PHYRate | 0x0000 | +| * FullDuplex | 0x0001 | +| * PacketRxCount | 0x0002 | +| * PacketTxCount | 0x0003 | +| * TxErrCount | 0x0004 | +| * CollisionCount | 0x0005 | +| * OverrunCount | 0x0006 | +| * CarrierDetect | 0x0007 | +| * TimeSinceReset | 0x0008 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Command StopPlayback + * Command ResetCounts */ -class MediaPlaybackStopPlayback : public ClusterCommand { +class EthernetNetworkDiagnosticsResetCounts : public ClusterCommand { public: - MediaPlaybackStopPlayback() - : ClusterCommand("stop-playback") + EthernetNetworkDiagnosticsResetCounts() + : ClusterCommand("reset-counts") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPMediaPlaybackClusterStopPlaybackParams alloc] init]; + __auto_type * params = [[CHIPEthernetNetworkDiagnosticsClusterResetCountsParams 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 stopPlaybackWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); + [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; if (chipError != CHIP_NO_ERROR) { @@ -36014,33 +38909,36 @@ class MediaPlaybackStopPlayback : public ClusterCommand { } private: + chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type mRequest; }; /* - * Attribute CurrentState + * Attribute PHYRate */ -class ReadMediaPlaybackCurrentState : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsPHYRate : public ReadAttribute { public: - ReadMediaPlaybackCurrentState() - : ReadAttribute("current-state") + ReadEthernetNetworkDiagnosticsPHYRate() + : ReadAttribute("phyrate") { } - ~ReadMediaPlaybackCurrentState() {} + ~ReadEthernetNetworkDiagnosticsPHYRate() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.CurrentState response %@", [value description]); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback CurrentState read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics PHYRate read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36048,34 +38946,36 @@ class ReadMediaPlaybackCurrentState : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackCurrentState : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsPHYRate : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackCurrentState() - : SubscribeAttribute("current-state") + SubscribeAttributeEthernetNetworkDiagnosticsPHYRate() + : SubscribeAttribute("phyrate") { } - ~SubscribeAttributeMediaPlaybackCurrentState() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsPHYRate() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.CurrentState response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePHYRateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36087,30 +38987,32 @@ class SubscribeAttributeMediaPlaybackCurrentState : public SubscribeAttribute { }; /* - * Attribute StartTime + * Attribute FullDuplex */ -class ReadMediaPlaybackStartTime : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsFullDuplex : public ReadAttribute { public: - ReadMediaPlaybackStartTime() - : ReadAttribute("start-time") + ReadEthernetNetworkDiagnosticsFullDuplex() + : ReadAttribute("full-duplex") { } - ~ReadMediaPlaybackStartTime() {} + ~ReadEthernetNetworkDiagnosticsFullDuplex() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.StartTime response %@", [value description]); + [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback StartTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics FullDuplex read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36118,34 +39020,36 @@ class ReadMediaPlaybackStartTime : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackStartTime : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackStartTime() - : SubscribeAttribute("start-time") + SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex() + : SubscribeAttribute("full-duplex") { } - ~SubscribeAttributeMediaPlaybackStartTime() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStartTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.StartTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFullDuplexWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36157,30 +39061,32 @@ class SubscribeAttributeMediaPlaybackStartTime : public SubscribeAttribute { }; /* - * Attribute Duration + * Attribute PacketRxCount */ -class ReadMediaPlaybackDuration : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsPacketRxCount : public ReadAttribute { public: - ReadMediaPlaybackDuration() - : ReadAttribute("duration") + ReadEthernetNetworkDiagnosticsPacketRxCount() + : ReadAttribute("packet-rx-count") { } - ~ReadMediaPlaybackDuration() {} + ~ReadEthernetNetworkDiagnosticsPacketRxCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.Duration response %@", [value description]); + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback Duration read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics PacketRxCount read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36188,34 +39094,37 @@ class ReadMediaPlaybackDuration : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackDuration : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackDuration() - : SubscribeAttribute("duration") + SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount() + : SubscribeAttribute("packet-rx-count") { } - ~SubscribeAttributeMediaPlaybackDuration() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDurationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.Duration response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePacketRxCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36227,31 +39136,32 @@ class SubscribeAttributeMediaPlaybackDuration : public SubscribeAttribute { }; /* - * Attribute SampledPosition + * Attribute PacketTxCount */ -class ReadMediaPlaybackSampledPosition : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsPacketTxCount : public ReadAttribute { public: - ReadMediaPlaybackSampledPosition() - : ReadAttribute("sampled-position") + ReadEthernetNetworkDiagnosticsPacketTxCount() + : ReadAttribute("packet-tx-count") { } - ~ReadMediaPlaybackSampledPosition() {} + ~ReadEthernetNetworkDiagnosticsPacketTxCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSampledPositionWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback SampledPosition read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics PacketTxCount read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36259,70 +39169,74 @@ class ReadMediaPlaybackSampledPosition : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackSampledPosition : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackSampledPosition() - : SubscribeAttribute("sampled-position") + SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount() + : SubscribeAttribute("packet-tx-count") { } - ~SubscribeAttributeMediaPlaybackSampledPosition() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSampledPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, - NSError * _Nullable error) { - NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override + [cluster subscribeAttributePacketTxCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } }; /* - * Attribute PlaybackSpeed + * Attribute TxErrCount */ -class ReadMediaPlaybackPlaybackSpeed : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsTxErrCount : public ReadAttribute { public: - ReadMediaPlaybackPlaybackSpeed() - : ReadAttribute("playback-speed") + ReadEthernetNetworkDiagnosticsTxErrCount() + : ReadAttribute("tx-err-count") { } - ~ReadMediaPlaybackPlaybackSpeed() {} + ~ReadEthernetNetworkDiagnosticsTxErrCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback PlaybackSpeed read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics TxErrCount read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36330,34 +39244,36 @@ class ReadMediaPlaybackPlaybackSpeed : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackPlaybackSpeed : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackPlaybackSpeed() - : SubscribeAttribute("playback-speed") + SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount() + : SubscribeAttribute("tx-err-count") { } - ~SubscribeAttributeMediaPlaybackPlaybackSpeed() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePlaybackSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeTxErrCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36369,30 +39285,32 @@ class SubscribeAttributeMediaPlaybackPlaybackSpeed : public SubscribeAttribute { }; /* - * Attribute SeekRangeEnd + * Attribute CollisionCount */ -class ReadMediaPlaybackSeekRangeEnd : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsCollisionCount : public ReadAttribute { public: - ReadMediaPlaybackSeekRangeEnd() - : ReadAttribute("seek-range-end") + ReadEthernetNetworkDiagnosticsCollisionCount() + : ReadAttribute("collision-count") { } - ~ReadMediaPlaybackSeekRangeEnd() {} + ~ReadEthernetNetworkDiagnosticsCollisionCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSeekRangeEndWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback SeekRangeEnd read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics CollisionCount read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36400,34 +39318,37 @@ class ReadMediaPlaybackSeekRangeEnd : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackSeekRangeEnd : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackSeekRangeEnd() - : SubscribeAttribute("seek-range-end") + SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount() + : SubscribeAttribute("collision-count") { } - ~SubscribeAttributeMediaPlaybackSeekRangeEnd() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSeekRangeEndWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCollisionCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36439,30 +39360,32 @@ class SubscribeAttributeMediaPlaybackSeekRangeEnd : public SubscribeAttribute { }; /* - * Attribute SeekRangeStart + * Attribute OverrunCount */ -class ReadMediaPlaybackSeekRangeStart : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsOverrunCount : public ReadAttribute { public: - ReadMediaPlaybackSeekRangeStart() - : ReadAttribute("seek-range-start") + ReadEthernetNetworkDiagnosticsOverrunCount() + : ReadAttribute("overrun-count") { } - ~ReadMediaPlaybackSeekRangeStart() {} + ~ReadEthernetNetworkDiagnosticsOverrunCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSeekRangeStartWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback SeekRangeStart read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics OverrunCount read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36470,34 +39393,37 @@ class ReadMediaPlaybackSeekRangeStart : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackSeekRangeStart : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackSeekRangeStart() - : SubscribeAttribute("seek-range-start") + SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount() + : SubscribeAttribute("overrun-count") { } - ~SubscribeAttributeMediaPlaybackSeekRangeStart() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSeekRangeStartWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeOverrunCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36509,30 +39435,32 @@ class SubscribeAttributeMediaPlaybackSeekRangeStart : public SubscribeAttribute }; /* - * Attribute GeneratedCommandList + * Attribute CarrierDetect */ -class ReadMediaPlaybackGeneratedCommandList : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsCarrierDetect : public ReadAttribute { public: - ReadMediaPlaybackGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadEthernetNetworkDiagnosticsCarrierDetect() + : ReadAttribute("carrier-detect") { } - ~ReadMediaPlaybackGeneratedCommandList() {} + ~ReadEthernetNetworkDiagnosticsCarrierDetect() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); + [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics CarrierDetect read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36540,35 +39468,37 @@ class ReadMediaPlaybackGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect() + : SubscribeAttribute("carrier-detect") { } - ~SubscribeAttributeMediaPlaybackGeneratedCommandList() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCarrierDetectWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36580,30 +39510,32 @@ class SubscribeAttributeMediaPlaybackGeneratedCommandList : public SubscribeAttr }; /* - * Attribute AcceptedCommandList + * Attribute TimeSinceReset */ -class ReadMediaPlaybackAcceptedCommandList : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsTimeSinceReset : public ReadAttribute { public: - ReadMediaPlaybackAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadEthernetNetworkDiagnosticsTimeSinceReset() + : ReadAttribute("time-since-reset") { } - ~ReadMediaPlaybackAcceptedCommandList() {} + ~ReadEthernetNetworkDiagnosticsTimeSinceReset() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); + [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics TimeSinceReset read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36611,31 +39543,33 @@ class ReadMediaPlaybackAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset() + : SubscribeAttribute("time-since-reset") { } - ~SubscribeAttributeMediaPlaybackAcceptedCommandList() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeTimeSinceResetWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -36651,30 +39585,32 @@ class SubscribeAttributeMediaPlaybackAcceptedCommandList : public SubscribeAttri }; /* - * Attribute AttributeList + * Attribute GeneratedCommandList */ -class ReadMediaPlaybackAttributeList : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsGeneratedCommandList : public ReadAttribute { public: - ReadMediaPlaybackAttributeList() - : ReadAttribute("attribute-list") + ReadEthernetNetworkDiagnosticsGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadMediaPlaybackAttributeList() {} + ~ReadEthernetNetworkDiagnosticsGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.AttributeList response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36682,34 +39618,37 @@ class ReadMediaPlaybackAttributeList : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackAttributeList : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeMediaPlaybackAttributeList() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36721,30 +39660,32 @@ class SubscribeAttributeMediaPlaybackAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute AcceptedCommandList */ -class ReadMediaPlaybackClusterRevision : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { public: - ReadMediaPlaybackClusterRevision() - : ReadAttribute("cluster-revision") + ReadEthernetNetworkDiagnosticsAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadMediaPlaybackClusterRevision() {} + ~ReadEthernetNetworkDiagnosticsAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "MediaPlayback ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36752,34 +39693,37 @@ class ReadMediaPlaybackClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeMediaPlaybackClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeMediaPlaybackClusterRevision() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36790,99 +39734,33 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute } }; -/*----------------------------------------------------------------------------*\ -| Cluster ModeSelect | 0x0050 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ChangeToMode | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Description | 0x0000 | -| * StandardNamespace | 0x0001 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ChangeToMode - */ -class ModeSelectChangeToMode : public ClusterCommand { -public: - ModeSelectChangeToMode() - : ClusterCommand("change-to-mode") - { - AddArgument("NewMode", 0, UINT8_MAX, &mNewMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.newMode = [NSNumber numberWithUnsignedChar:mNewMode]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster changeToModeWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mNewMode; -}; - /* - * Attribute Description + * Attribute AttributeList */ -class ReadModeSelectDescription : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsAttributeList : public ReadAttribute { public: - ReadModeSelectDescription() - : ReadAttribute("description") + ReadEthernetNetworkDiagnosticsAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadModeSelectDescription() {} + ~ReadEthernetNetworkDiagnosticsAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.Description response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect Description read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36890,34 +39768,37 @@ class ReadModeSelectDescription : public ReadAttribute { } }; -class SubscribeAttributeModeSelectDescription : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsAttributeList : public SubscribeAttribute { public: - SubscribeAttributeModeSelectDescription() - : SubscribeAttribute("description") + SubscribeAttributeEthernetNetworkDiagnosticsAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeModeSelectDescription() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.Description response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36929,30 +39810,32 @@ class SubscribeAttributeModeSelectDescription : public SubscribeAttribute { }; /* - * Attribute StandardNamespace + * Attribute FeatureMap */ -class ReadModeSelectStandardNamespace : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsFeatureMap : public ReadAttribute { public: - ReadModeSelectStandardNamespace() - : ReadAttribute("standard-namespace") + ReadEthernetNetworkDiagnosticsFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadModeSelectStandardNamespace() {} + ~ReadEthernetNetworkDiagnosticsFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect StandardNamespace read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -36960,34 +39843,36 @@ class ReadModeSelectStandardNamespace : public ReadAttribute { } }; -class SubscribeAttributeModeSelectStandardNamespace : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeModeSelectStandardNamespace() - : SubscribeAttribute("standard-namespace") + SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeModeSelectStandardNamespace() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStandardNamespaceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -36999,30 +39884,32 @@ class SubscribeAttributeModeSelectStandardNamespace : public SubscribeAttribute }; /* - * Attribute SupportedModes + * Attribute ClusterRevision */ -class ReadModeSelectSupportedModes : public ReadAttribute { +class ReadEthernetNetworkDiagnosticsClusterRevision : public ReadAttribute { public: - ReadModeSelectSupportedModes() - : ReadAttribute("supported-modes") + ReadEthernetNetworkDiagnosticsClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadModeSelectSupportedModes() {} + ~ReadEthernetNetworkDiagnosticsClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.SupportedModes response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect SupportedModes read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "EthernetNetworkDiagnostics ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37030,34 +39917,37 @@ class ReadModeSelectSupportedModes : public ReadAttribute { } }; -class SubscribeAttributeModeSelectSupportedModes : public SubscribeAttribute { +class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeModeSelectSupportedModes() - : SubscribeAttribute("supported-modes") + SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeModeSelectSupportedModes() {} + ~SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSupportedModesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.SupportedModes response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37068,31 +39958,57 @@ class SubscribeAttributeModeSelectSupportedModes : public SubscribeAttribute { } }; +/*----------------------------------------------------------------------------*\ +| Cluster FanControl | 0x0202 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * FanMode | 0x0000 | +| * FanModeSequence | 0x0001 | +| * PercentSetting | 0x0002 | +| * PercentCurrent | 0x0003 | +| * SpeedMax | 0x0004 | +| * SpeedSetting | 0x0005 | +| * SpeedCurrent | 0x0006 | +| * RockSupport | 0x0007 | +| * RockSetting | 0x0008 | +| * WindSupport | 0x0009 | +| * WindSetting | 0x000A | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute CurrentMode + * Attribute FanMode */ -class ReadModeSelectCurrentMode : public ReadAttribute { +class ReadFanControlFanMode : public ReadAttribute { public: - ReadModeSelectCurrentMode() - : ReadAttribute("current-mode") + ReadFanControlFanMode() + : ReadAttribute("fan-mode") { } - ~ReadModeSelectCurrentMode() {} + ~ReadFanControlFanMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + [cluster readAttributeFanModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.FanMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect CurrentMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl FanMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37100,34 +40016,73 @@ class ReadModeSelectCurrentMode : public ReadAttribute { } }; -class SubscribeAttributeModeSelectCurrentMode : public SubscribeAttribute { +class WriteFanControlFanMode : public WriteAttribute { public: - SubscribeAttributeModeSelectCurrentMode() - : SubscribeAttribute("current-mode") + WriteFanControlFanMode() + : WriteAttribute("fan-mode") { + AddArgument("attr-name", "fan-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeModeSelectCurrentMode() {} + ~WriteFanControlFanMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeFanModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "FanControl FanMode write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlFanMode : public SubscribeAttribute { +public: + SubscribeAttributeFanControlFanMode() + : SubscribeAttribute("fan-mode") + { + } + + ~SubscribeAttributeFanControlFanMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.CurrentMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFanModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.FanMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37139,30 +40094,30 @@ class SubscribeAttributeModeSelectCurrentMode : public SubscribeAttribute { }; /* - * Attribute StartUpMode + * Attribute FanModeSequence */ -class ReadModeSelectStartUpMode : public ReadAttribute { +class ReadFanControlFanModeSequence : public ReadAttribute { public: - ReadModeSelectStartUpMode() - : ReadAttribute("start-up-mode") + ReadFanControlFanModeSequence() + : ReadAttribute("fan-mode-sequence") { } - ~ReadModeSelectStartUpMode() {} + ~ReadFanControlFanModeSequence() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.StartUpMode response %@", [value description]); + [cluster readAttributeFanModeSequenceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.FanModeSequence response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect StartUpMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl FanModeSequence read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37170,39 +40125,39 @@ class ReadModeSelectStartUpMode : public ReadAttribute { } }; -class WriteModeSelectStartUpMode : public WriteAttribute { +class WriteFanControlFanModeSequence : public WriteAttribute { public: - WriteModeSelectStartUpMode() - : WriteAttribute("start-up-mode") + WriteFanControlFanModeSequence() + : WriteAttribute("fan-mode-sequence") { - AddArgument("attr-name", "start-up-mode"); + AddArgument("attr-name", "fan-mode-sequence"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteModeSelectStartUpMode() {} + ~WriteFanControlFanModeSequence() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeStartUpModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "ModeSelect StartUpMode write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeFanModeSequenceWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "FanControl FanModeSequence write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -37210,34 +40165,34 @@ class WriteModeSelectStartUpMode : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { +class SubscribeAttributeFanControlFanModeSequence : public SubscribeAttribute { public: - SubscribeAttributeModeSelectStartUpMode() - : SubscribeAttribute("start-up-mode") + SubscribeAttributeFanControlFanModeSequence() + : SubscribeAttribute("fan-mode-sequence") { } - ~SubscribeAttributeModeSelectStartUpMode() {} + ~SubscribeAttributeFanControlFanModeSequence() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStartUpModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.StartUpMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFanModeSequenceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.FanModeSequence response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37249,30 +40204,30 @@ class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { }; /* - * Attribute OnMode + * Attribute PercentSetting */ -class ReadModeSelectOnMode : public ReadAttribute { +class ReadFanControlPercentSetting : public ReadAttribute { public: - ReadModeSelectOnMode() - : ReadAttribute("on-mode") + ReadFanControlPercentSetting() + : ReadAttribute("percent-setting") { } - ~ReadModeSelectOnMode() {} + ~ReadFanControlPercentSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.OnMode response %@", [value description]); + [cluster readAttributePercentSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentSetting response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect OnMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl PercentSetting read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37280,38 +40235,39 @@ class ReadModeSelectOnMode : public ReadAttribute { } }; -class WriteModeSelectOnMode : public WriteAttribute { +class WriteFanControlPercentSetting : public WriteAttribute { public: - WriteModeSelectOnMode() - : WriteAttribute("on-mode") + WriteFanControlPercentSetting() + : WriteAttribute("percent-setting") { - AddArgument("attr-name", "on-mode"); + AddArgument("attr-name", "percent-setting"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteModeSelectOnMode() {} + ~WriteFanControlPercentSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeOnModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "ModeSelect OnMode write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributePercentSettingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "FanControl PercentSetting write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -37319,34 +40275,34 @@ class WriteModeSelectOnMode : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { +class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { public: - SubscribeAttributeModeSelectOnMode() - : SubscribeAttribute("on-mode") + SubscribeAttributeFanControlPercentSetting() + : SubscribeAttribute("percent-setting") { } - ~SubscribeAttributeModeSelectOnMode() {} + ~SubscribeAttributeFanControlPercentSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOnModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.OnMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePercentSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentSetting response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37358,30 +40314,30 @@ class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute PercentCurrent */ -class ReadModeSelectGeneratedCommandList : public ReadAttribute { +class ReadFanControlPercentCurrent : public ReadAttribute { public: - ReadModeSelectGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadFanControlPercentCurrent() + : ReadAttribute("percent-current") { } - ~ReadModeSelectGeneratedCommandList() {} + ~ReadFanControlPercentCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); + [cluster readAttributePercentCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl PercentCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37389,35 +40345,34 @@ class ReadModeSelectGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeModeSelectGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeFanControlPercentCurrent : public SubscribeAttribute { public: - SubscribeAttributeModeSelectGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeFanControlPercentCurrent() + : SubscribeAttribute("percent-current") { } - ~SubscribeAttributeModeSelectGeneratedCommandList() {} + ~SubscribeAttributeFanControlPercentCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePercentCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.PercentCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37429,30 +40384,30 @@ class SubscribeAttributeModeSelectGeneratedCommandList : public SubscribeAttribu }; /* - * Attribute AcceptedCommandList + * Attribute SpeedMax */ -class ReadModeSelectAcceptedCommandList : public ReadAttribute { +class ReadFanControlSpeedMax : public ReadAttribute { public: - ReadModeSelectAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadFanControlSpeedMax() + : ReadAttribute("speed-max") { } - ~ReadModeSelectAcceptedCommandList() {} + ~ReadFanControlSpeedMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); + [cluster readAttributeSpeedMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedMax response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl SpeedMax read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37460,35 +40415,34 @@ class ReadModeSelectAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeModeSelectAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeFanControlSpeedMax : public SubscribeAttribute { public: - SubscribeAttributeModeSelectAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeFanControlSpeedMax() + : SubscribeAttribute("speed-max") { } - ~SubscribeAttributeModeSelectAcceptedCommandList() {} + ~SubscribeAttributeFanControlSpeedMax() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSpeedMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37500,30 +40454,30 @@ class SubscribeAttributeModeSelectAcceptedCommandList : public SubscribeAttribut }; /* - * Attribute AttributeList + * Attribute SpeedSetting */ -class ReadModeSelectAttributeList : public ReadAttribute { +class ReadFanControlSpeedSetting : public ReadAttribute { public: - ReadModeSelectAttributeList() - : ReadAttribute("attribute-list") + ReadFanControlSpeedSetting() + : ReadAttribute("speed-setting") { } - ~ReadModeSelectAttributeList() {} + ~ReadFanControlSpeedSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.AttributeList response %@", [value description]); + [cluster readAttributeSpeedSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedSetting response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl SpeedSetting read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37531,34 +40485,74 @@ class ReadModeSelectAttributeList : public ReadAttribute { } }; -class SubscribeAttributeModeSelectAttributeList : public SubscribeAttribute { +class WriteFanControlSpeedSetting : public WriteAttribute { public: - SubscribeAttributeModeSelectAttributeList() - : SubscribeAttribute("attribute-list") + WriteFanControlSpeedSetting() + : WriteAttribute("speed-setting") { + AddArgument("attr-name", "speed-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeModeSelectAttributeList() {} + ~WriteFanControlSpeedSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributeSpeedSettingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "FanControl SpeedSetting write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { +public: + SubscribeAttributeFanControlSpeedSetting() + : SubscribeAttribute("speed-setting") + { + } + + ~SubscribeAttributeFanControlSpeedSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSpeedSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedSetting response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37570,30 +40564,30 @@ class SubscribeAttributeModeSelectAttributeList : public SubscribeAttribute { }; /* - * Attribute FeatureMap + * Attribute SpeedCurrent */ -class ReadModeSelectFeatureMap : public ReadAttribute { +class ReadFanControlSpeedCurrent : public ReadAttribute { public: - ReadModeSelectFeatureMap() - : ReadAttribute("feature-map") + ReadFanControlSpeedCurrent() + : ReadAttribute("speed-current") { } - ~ReadModeSelectFeatureMap() {} + ~ReadFanControlSpeedCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + [cluster readAttributeSpeedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedCurrent response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl SpeedCurrent read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37601,34 +40595,34 @@ class ReadModeSelectFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeModeSelectFeatureMap : public SubscribeAttribute { +class SubscribeAttributeFanControlSpeedCurrent : public SubscribeAttribute { public: - SubscribeAttributeModeSelectFeatureMap() - : SubscribeAttribute("feature-map") + SubscribeAttributeFanControlSpeedCurrent() + : SubscribeAttribute("speed-current") { } - ~SubscribeAttributeModeSelectFeatureMap() {} + ~SubscribeAttributeFanControlSpeedCurrent() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.FeatureMap response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSpeedCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37640,30 +40634,30 @@ class SubscribeAttributeModeSelectFeatureMap : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute RockSupport */ -class ReadModeSelectClusterRevision : public ReadAttribute { +class ReadFanControlRockSupport : public ReadAttribute { public: - ReadModeSelectClusterRevision() - : ReadAttribute("cluster-revision") + ReadFanControlRockSupport() + : ReadAttribute("rock-support") { } - ~ReadModeSelectClusterRevision() {} + ~ReadFanControlRockSupport() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); + [cluster readAttributeRockSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSupport response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "ModeSelect ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl RockSupport read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -37671,34 +40665,34 @@ class ReadModeSelectClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { +class SubscribeAttributeFanControlRockSupport : public SubscribeAttribute { public: - SubscribeAttributeModeSelectClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeFanControlRockSupport() + : SubscribeAttribute("rock-support") { } - ~SubscribeAttributeModeSelectClusterRevision() {} + ~SubscribeAttributeFanControlRockSupport() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRockSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSupport response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -37709,402 +40703,211 @@ class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster NetworkCommissioning | 0x0031 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ScanNetworks | 0x00 | -| * AddOrUpdateWiFiNetwork | 0x02 | -| * AddOrUpdateThreadNetwork | 0x03 | -| * RemoveNetwork | 0x04 | -| * ConnectNetwork | 0x06 | -| * ReorderNetwork | 0x08 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MaxNetworks | 0x0000 | -| * Networks | 0x0001 | -| * ScanMaxTimeSeconds | 0x0002 | -| * ConnectMaxTimeSeconds | 0x0003 | -| * InterfaceEnabled | 0x0004 | -| * LastNetworkingStatus | 0x0005 | -| * LastNetworkID | 0x0006 | -| * LastConnectErrorValue | 0x0007 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command AddOrUpdateThreadNetwork + * Attribute RockSetting */ -class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { +class ReadFanControlRockSetting : public ReadAttribute { public: - NetworkCommissioningAddOrUpdateThreadNetwork() - : ClusterCommand("add-or-update-thread-network") + ReadFanControlRockSetting() + : ReadAttribute("rock-setting") { - AddArgument("OperationalDataset", &mOperationalDataset); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); } + ~ReadFanControlRockSetting() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.operationalDataset = [[NSData alloc] initWithBytes:mOperationalDataset.data() length:mOperationalDataset.size()]; - if (mBreadcrumb.HasValue()) { - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - addOrUpdateThreadNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeRockSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSetting response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::ByteSpan mOperationalDataset; - chip::Optional mBreadcrumb; + if (error != nil) { + ChipLogError(chipTool, "FanControl RockSetting read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command AddOrUpdateWiFiNetwork - */ -class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { +class WriteFanControlRockSetting : public WriteAttribute { public: - NetworkCommissioningAddOrUpdateWiFiNetwork() - : ClusterCommand("add-or-update-wi-fi-network") + WriteFanControlRockSetting() + : WriteAttribute("rock-setting") { - AddArgument("Ssid", &mSsid); - AddArgument("Credentials", &mCredentials); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); + AddArgument("attr-name", "rock-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } + ~WriteFanControlRockSetting() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000002) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; - params.credentials = [[NSData alloc] initWithBytes:mCredentials.data() length:mCredentials.size()]; - if (mBreadcrumb.HasValue()) { - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - addOrUpdateWiFiNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributeRockSettingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "FanControl RockSetting write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mSsid; - chip::ByteSpan mCredentials; - chip::Optional mBreadcrumb; + uint8_t mValue; }; -/* - * Command ConnectNetwork - */ -class NetworkCommissioningConnectNetwork : public ClusterCommand { +class SubscribeAttributeFanControlRockSetting : public SubscribeAttribute { public: - NetworkCommissioningConnectNetwork() - : ClusterCommand("connect-network") + SubscribeAttributeFanControlRockSetting() + : SubscribeAttribute("rock-setting") { - AddArgument("NetworkID", &mNetworkID); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeFanControlRockSetting() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000006) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPNetworkCommissioningClusterConnectNetworkParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - if (mBreadcrumb.HasValue()) { - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster connectNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeRockSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.RockSetting response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::ByteSpan mNetworkID; - chip::Optional mBreadcrumb; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command RemoveNetwork + * Attribute WindSupport */ -class NetworkCommissioningRemoveNetwork : public ClusterCommand { +class ReadFanControlWindSupport : public ReadAttribute { public: - NetworkCommissioningRemoveNetwork() - : ClusterCommand("remove-network") + ReadFanControlWindSupport() + : ReadAttribute("wind-support") { - AddArgument("NetworkID", &mNetworkID); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); } + ~ReadFanControlWindSupport() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPNetworkCommissioningClusterRemoveNetworkParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - if (mBreadcrumb.HasValue()) { - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster removeNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWindSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSupport response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::ByteSpan mNetworkID; - chip::Optional mBreadcrumb; + if (error != nil) { + ChipLogError(chipTool, "FanControl WindSupport read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command ReorderNetwork - */ -class NetworkCommissioningReorderNetwork : public ClusterCommand { +class SubscribeAttributeFanControlWindSupport : public SubscribeAttribute { public: - NetworkCommissioningReorderNetwork() - : ClusterCommand("reorder-network") + SubscribeAttributeFanControlWindSupport() + : SubscribeAttribute("wind-support") { - AddArgument("NetworkID", &mNetworkID); - AddArgument("NetworkIndex", 0, UINT8_MAX, &mNetworkIndex); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeFanControlWindSupport() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000008) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPNetworkCommissioningClusterReorderNetworkParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - params.networkIndex = [NSNumber numberWithUnsignedChar:mNetworkIndex]; - if (mBreadcrumb.HasValue()) { - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster reorderNetworkWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - chip::ByteSpan mNetworkID; - uint8_t mNetworkIndex; - chip::Optional mBreadcrumb; -}; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeWindSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSupport response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command ScanNetworks - */ -class NetworkCommissioningScanNetworks : public ClusterCommand { -public: - NetworkCommissioningScanNetworks() - : ClusterCommand("scan-networks") - { - AddArgument("Ssid", &mSsid); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPNetworkCommissioningClusterScanNetworksParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - if (mSsid.HasValue()) { - params.ssid = [[NSData alloc] initWithBytes:mSsid.Value().data() length:mSsid.Value().size()]; - } - if (mBreadcrumb.HasValue()) { - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster scanNetworksWithParams:params - completionHandler:^(CHIPNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: - chip::Optional mSsid; - chip::Optional mBreadcrumb; }; /* - * Attribute MaxNetworks + * Attribute WindSetting */ -class ReadNetworkCommissioningMaxNetworks : public ReadAttribute { +class ReadFanControlWindSetting : public ReadAttribute { public: - ReadNetworkCommissioningMaxNetworks() - : ReadAttribute("max-networks") + ReadFanControlWindSetting() + : ReadAttribute("wind-setting") { } - ~ReadNetworkCommissioningMaxNetworks() {} + ~ReadFanControlWindSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000000A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxNetworksWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); + [cluster readAttributeWindSettingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.WindSetting response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning MaxNetworks read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl WindSetting read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38112,32 +40915,70 @@ class ReadNetworkCommissioningMaxNetworks : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningMaxNetworks : public SubscribeAttribute { +class WriteFanControlWindSetting : public WriteAttribute { public: - SubscribeAttributeNetworkCommissioningMaxNetworks() - : SubscribeAttribute("max-networks") + WriteFanControlWindSetting() + : WriteAttribute("wind-setting") { + AddArgument("attr-name", "wind-setting"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeNetworkCommissioningMaxNetworks() {} + ~WriteFanControlWindSetting() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x0000000A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributeWindSettingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "FanControl WindSetting write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeFanControlWindSetting : public SubscribeAttribute { +public: + SubscribeAttributeFanControlWindSetting() + : SubscribeAttribute("wind-setting") + { + } + + ~SubscribeAttributeFanControlWindSetting() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxNetworksWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeWindSettingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); + NSLog(@"FanControl.WindSetting response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -38153,32 +40994,30 @@ class SubscribeAttributeNetworkCommissioningMaxNetworks : public SubscribeAttrib }; /* - * Attribute Networks + * Attribute GeneratedCommandList */ -class ReadNetworkCommissioningNetworks : public ReadAttribute { +class ReadFanControlGeneratedCommandList : public ReadAttribute { public: - ReadNetworkCommissioningNetworks() - : ReadAttribute("networks") + ReadFanControlGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadNetworkCommissioningNetworks() {} + ~ReadFanControlGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNetworksWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.Networks response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning Networks read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38186,36 +41025,35 @@ class ReadNetworkCommissioningNetworks : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningNetworks : public SubscribeAttribute { +class SubscribeAttributeFanControlGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningNetworks() - : SubscribeAttribute("networks") + SubscribeAttributeFanControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeNetworkCommissioningNetworks() {} + ~SubscribeAttributeFanControlGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNetworksWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.Networks response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38227,32 +41065,30 @@ class SubscribeAttributeNetworkCommissioningNetworks : public SubscribeAttribute }; /* - * Attribute ScanMaxTimeSeconds + * Attribute AcceptedCommandList */ -class ReadNetworkCommissioningScanMaxTimeSeconds : public ReadAttribute { +class ReadFanControlAcceptedCommandList : public ReadAttribute { public: - ReadNetworkCommissioningScanMaxTimeSeconds() - : ReadAttribute("scan-max-time-seconds") + ReadFanControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadNetworkCommissioningScanMaxTimeSeconds() {} + ~ReadFanControlAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeScanMaxTimeSecondsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning ScanMaxTimeSeconds read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38260,37 +41096,35 @@ class ReadNetworkCommissioningScanMaxTimeSeconds : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds : public SubscribeAttribute { +class SubscribeAttributeFanControlAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds() - : SubscribeAttribute("scan-max-time-seconds") + SubscribeAttributeFanControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds() {} + ~SubscribeAttributeFanControlAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeScanMaxTimeSecondsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38302,32 +41136,30 @@ class SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds : public Subscrib }; /* - * Attribute ConnectMaxTimeSeconds + * Attribute AttributeList */ -class ReadNetworkCommissioningConnectMaxTimeSeconds : public ReadAttribute { +class ReadFanControlAttributeList : public ReadAttribute { public: - ReadNetworkCommissioningConnectMaxTimeSeconds() - : ReadAttribute("connect-max-time-seconds") + ReadFanControlAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadNetworkCommissioningConnectMaxTimeSeconds() {} + ~ReadFanControlAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeConnectMaxTimeSecondsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning ConnectMaxTimeSeconds read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38335,37 +41167,34 @@ class ReadNetworkCommissioningConnectMaxTimeSeconds : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds : public SubscribeAttribute { +class SubscribeAttributeFanControlAttributeList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds() - : SubscribeAttribute("connect-max-time-seconds") + SubscribeAttributeFanControlAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds() {} + ~SubscribeAttributeFanControlAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeConnectMaxTimeSecondsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38377,32 +41206,30 @@ class SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds : public Subsc }; /* - * Attribute InterfaceEnabled + * Attribute FeatureMap */ -class ReadNetworkCommissioningInterfaceEnabled : public ReadAttribute { +class ReadFanControlFeatureMap : public ReadAttribute { public: - ReadNetworkCommissioningInterfaceEnabled() - : ReadAttribute("interface-enabled") + ReadFanControlFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadNetworkCommissioningInterfaceEnabled() {} + ~ReadFanControlFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInterfaceEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning InterfaceEnabled read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38410,79 +41237,34 @@ class ReadNetworkCommissioningInterfaceEnabled : public ReadAttribute { } }; -class WriteNetworkCommissioningInterfaceEnabled : public WriteAttribute { -public: - WriteNetworkCommissioningInterfaceEnabled() - : WriteAttribute("interface-enabled") - { - AddArgument("attr-name", "interface-enabled"); - AddArgument("attr-value", 0, 1, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteNetworkCommissioningInterfaceEnabled() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) WriteAttribute (0x00000004) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - - [cluster writeAttributeInterfaceEnabledWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning InterfaceEnabled write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - bool mValue; -}; - -class SubscribeAttributeNetworkCommissioningInterfaceEnabled : public SubscribeAttribute { +class SubscribeAttributeFanControlFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningInterfaceEnabled() - : SubscribeAttribute("interface-enabled") + SubscribeAttributeFanControlFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeNetworkCommissioningInterfaceEnabled() {} + ~SubscribeAttributeFanControlFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInterfaceEnabledWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38494,32 +41276,30 @@ class SubscribeAttributeNetworkCommissioningInterfaceEnabled : public SubscribeA }; /* - * Attribute LastNetworkingStatus + * Attribute ClusterRevision */ -class ReadNetworkCommissioningLastNetworkingStatus : public ReadAttribute { +class ReadFanControlClusterRevision : public ReadAttribute { public: - ReadNetworkCommissioningLastNetworkingStatus() - : ReadAttribute("last-networking-status") + ReadFanControlClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadNetworkCommissioningLastNetworkingStatus() {} + ~ReadFanControlClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLastNetworkingStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning LastNetworkingStatus read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FanControl ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38527,37 +41307,34 @@ class ReadNetworkCommissioningLastNetworkingStatus : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningLastNetworkingStatus : public SubscribeAttribute { +class SubscribeAttributeFanControlClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningLastNetworkingStatus() - : SubscribeAttribute("last-networking-status") + SubscribeAttributeFanControlClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeNetworkCommissioningLastNetworkingStatus() {} + ~SubscribeAttributeFanControlClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000202) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFanControl * cluster = [[CHIPFanControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLastNetworkingStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FanControl.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38568,33 +41345,47 @@ class SubscribeAttributeNetworkCommissioningLastNetworkingStatus : public Subscr } }; +/*----------------------------------------------------------------------------*\ +| Cluster FixedLabel | 0x0040 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * LabelList | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute LastNetworkID + * Attribute LabelList */ -class ReadNetworkCommissioningLastNetworkID : public ReadAttribute { +class ReadFixedLabelLabelList : public ReadAttribute { public: - ReadNetworkCommissioningLastNetworkID() - : ReadAttribute("last-network-id") + ReadFixedLabelLabelList() + : ReadAttribute("label-list") { } - ~ReadNetworkCommissioningLastNetworkID() {} + ~ReadFixedLabelLabelList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLastNetworkIDWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); + [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.LabelList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning LastNetworkID read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FixedLabel LabelList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38602,36 +41393,34 @@ class ReadNetworkCommissioningLastNetworkID : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningLastNetworkID : public SubscribeAttribute { +class SubscribeAttributeFixedLabelLabelList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningLastNetworkID() - : SubscribeAttribute("last-network-id") + SubscribeAttributeFixedLabelLabelList() + : SubscribeAttribute("label-list") { } - ~SubscribeAttributeNetworkCommissioningLastNetworkID() {} + ~SubscribeAttributeFixedLabelLabelList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLastNetworkIDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLabelListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.LabelList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38643,32 +41432,30 @@ class SubscribeAttributeNetworkCommissioningLastNetworkID : public SubscribeAttr }; /* - * Attribute LastConnectErrorValue + * Attribute GeneratedCommandList */ -class ReadNetworkCommissioningLastConnectErrorValue : public ReadAttribute { +class ReadFixedLabelGeneratedCommandList : public ReadAttribute { public: - ReadNetworkCommissioningLastConnectErrorValue() - : ReadAttribute("last-connect-error-value") + ReadFixedLabelGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadNetworkCommissioningLastConnectErrorValue() {} + ~ReadFixedLabelGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLastConnectErrorValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning LastConnectErrorValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FixedLabel GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38676,37 +41463,35 @@ class ReadNetworkCommissioningLastConnectErrorValue : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public SubscribeAttribute { +class SubscribeAttributeFixedLabelGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningLastConnectErrorValue() - : SubscribeAttribute("last-connect-error-value") + SubscribeAttributeFixedLabelGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeNetworkCommissioningLastConnectErrorValue() {} + ~SubscribeAttributeFixedLabelGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLastConnectErrorValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38718,32 +41503,30 @@ class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public Subsc }; /* - * Attribute GeneratedCommandList + * Attribute AcceptedCommandList */ -class ReadNetworkCommissioningGeneratedCommandList : public ReadAttribute { +class ReadFixedLabelAcceptedCommandList : public ReadAttribute { public: - ReadNetworkCommissioningGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadFixedLabelAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadNetworkCommissioningGeneratedCommandList() {} + ~ReadFixedLabelAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FixedLabel AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38751,37 +41534,35 @@ class ReadNetworkCommissioningGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeFixedLabelAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeFixedLabelAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeNetworkCommissioningGeneratedCommandList() {} + ~SubscribeAttributeFixedLabelAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38793,32 +41574,30 @@ class SubscribeAttributeNetworkCommissioningGeneratedCommandList : public Subscr }; /* - * Attribute AcceptedCommandList + * Attribute AttributeList */ -class ReadNetworkCommissioningAcceptedCommandList : public ReadAttribute { +class ReadFixedLabelAttributeList : public ReadAttribute { public: - ReadNetworkCommissioningAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadFixedLabelAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadNetworkCommissioningAcceptedCommandList() {} + ~ReadFixedLabelAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FixedLabel AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38826,37 +41605,34 @@ class ReadNetworkCommissioningAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeFixedLabelAttributeList : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeFixedLabelAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeNetworkCommissioningAcceptedCommandList() {} + ~SubscribeAttributeFixedLabelAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -38870,30 +41646,28 @@ class SubscribeAttributeNetworkCommissioningAcceptedCommandList : public Subscri /* * Attribute FeatureMap */ -class ReadNetworkCommissioningFeatureMap : public ReadAttribute { +class ReadFixedLabelFeatureMap : public ReadAttribute { public: - ReadNetworkCommissioningFeatureMap() + ReadFixedLabelFeatureMap() : ReadAttribute("feature-map") { } - ~ReadNetworkCommissioningFeatureMap() {} + ~ReadFixedLabelFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); + NSLog(@"FixedLabel.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FixedLabel FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38901,22 +41675,20 @@ class ReadNetworkCommissioningFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningFeatureMap : public SubscribeAttribute { +class SubscribeAttributeFixedLabelFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningFeatureMap() + SubscribeAttributeFixedLabelFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeNetworkCommissioningFeatureMap() {} + ~SubscribeAttributeFixedLabelFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -38926,7 +41698,7 @@ class SubscribeAttributeNetworkCommissioningFeatureMap : public SubscribeAttribu params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); + NSLog(@"FixedLabel.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -38944,30 +41716,28 @@ class SubscribeAttributeNetworkCommissioningFeatureMap : public SubscribeAttribu /* * Attribute ClusterRevision */ -class ReadNetworkCommissioningClusterRevision : public ReadAttribute { +class ReadFixedLabelClusterRevision : public ReadAttribute { public: - ReadNetworkCommissioningClusterRevision() + ReadFixedLabelClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadNetworkCommissioningClusterRevision() {} + ~ReadFixedLabelClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); + NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "NetworkCommissioning ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FixedLabel ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -38975,37 +41745,34 @@ class ReadNetworkCommissioningClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeNetworkCommissioningClusterRevision : public SubscribeAttribute { +class SubscribeAttributeFixedLabelClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeNetworkCommissioningClusterRevision() + SubscribeAttributeFixedLabelClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeNetworkCommissioningClusterRevision() {} + ~SubscribeAttributeFixedLabelClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39017,14 +41784,15 @@ class SubscribeAttributeNetworkCommissioningClusterRevision : public SubscribeAt }; /*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateProvider | 0x0029 | +| Cluster FlowMeasurement | 0x0404 | |------------------------------------------------------------------------------| | Commands: | | -| * QueryImage | 0x00 | -| * ApplyUpdateRequest | 0x02 | -| * NotifyUpdateApplied | 0x04 | |------------------------------------------------------------------------------| | Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -39035,230 +41803,171 @@ class SubscribeAttributeNetworkCommissioningClusterRevision : public SubscribeAt \*----------------------------------------------------------------------------*/ /* - * Command ApplyUpdateRequest + * Attribute MeasuredValue */ -class OtaSoftwareUpdateProviderApplyUpdateRequest : public ClusterCommand { +class ReadFlowMeasurementMeasuredValue : public ReadAttribute { public: - OtaSoftwareUpdateProviderApplyUpdateRequest() - : ClusterCommand("apply-update-request") + ReadFlowMeasurementMeasuredValue() + : ReadAttribute("measured-value") { - AddArgument("UpdateToken", &mUpdateToken); - AddArgument("NewVersion", 0, UINT32_MAX, &mNewVersion); - ClusterCommand::AddArguments(); } + ~ReadFlowMeasurementMeasuredValue() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.updateToken = [[NSData alloc] initWithBytes:mUpdateToken.data() length:mUpdateToken.size()]; - params.newVersion = [NSNumber numberWithUnsignedInt:mNewVersion]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - applyUpdateRequestWithParams:params - completionHandler:^(CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::ByteSpan mUpdateToken; - uint32_t mNewVersion; + if (error != nil) { + ChipLogError(chipTool, "FlowMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command NotifyUpdateApplied - */ -class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ClusterCommand { +class SubscribeAttributeFlowMeasurementMeasuredValue : public SubscribeAttribute { public: - OtaSoftwareUpdateProviderNotifyUpdateApplied() - : ClusterCommand("notify-update-applied") + SubscribeAttributeFlowMeasurementMeasuredValue() + : SubscribeAttribute("measured-value") { - AddArgument("UpdateToken", &mUpdateToken); - AddArgument("SoftwareVersion", 0, UINT32_MAX, &mSoftwareVersion); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeFlowMeasurementMeasuredValue() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000004) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.updateToken = [[NSData alloc] initWithBytes:mUpdateToken.data() length:mUpdateToken.size()]; - params.softwareVersion = [NSNumber numberWithUnsignedInt:mSoftwareVersion]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster notifyUpdateAppliedWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::ByteSpan mUpdateToken; - uint32_t mSoftwareVersion; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command QueryImage + * Attribute MinMeasuredValue */ -class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { +class ReadFlowMeasurementMinMeasuredValue : public ReadAttribute { public: - OtaSoftwareUpdateProviderQueryImage() - : ClusterCommand("query-image") - , mComplex_ProtocolsSupported(&mRequest.protocolsSupported) + ReadFlowMeasurementMinMeasuredValue() + : ReadAttribute("min-measured-value") { - AddArgument("VendorId", 0, UINT16_MAX, &mVendorId); - AddArgument("ProductId", 0, UINT16_MAX, &mProductId); - AddArgument("SoftwareVersion", 0, UINT32_MAX, &mSoftwareVersion); - AddArgument("ProtocolsSupported", &mComplex_ProtocolsSupported); - AddArgument("HardwareVersion", 0, UINT16_MAX, &mHardwareVersion); - AddArgument("Location", &mLocation); - AddArgument("RequestorCanConsent", 0, 1, &mRequestorCanConsent); - AddArgument("MetadataForProvider", &mMetadataForProvider); - ClusterCommand::AddArguments(); } + ~ReadFlowMeasurementMinMeasuredValue() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterQueryImageParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; - params.productId = [NSNumber numberWithUnsignedShort:mProductId]; - params.softwareVersion = [NSNumber numberWithUnsignedInt:mSoftwareVersion]; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.protocolsSupported) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "FlowMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); } - params.protocolsSupported = array_0; - } - if (mHardwareVersion.HasValue()) { - params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion.Value()]; - } - if (mLocation.HasValue()) { - params.location = [[NSString alloc] initWithBytes:mLocation.Value().data() - length:mLocation.Value().size() - encoding:NSUTF8StringEncoding]; - } - if (mRequestorCanConsent.HasValue()) { - params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent.Value()]; - } - if (mMetadataForProvider.HasValue()) { - params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.Value().data() - length:mMetadataForProvider.Value().size()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster queryImageWithParams:params - completionHandler:^(CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + SetCommandExitStatus(err); + }]; + return err; } +}; -private: - chip::VendorId mVendorId; - uint16_t mProductId; - uint32_t mSoftwareVersion; - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type mRequest; - TypedComplexArgument> - mComplex_ProtocolsSupported; - chip::Optional mHardwareVersion; - chip::Optional mLocation; - chip::Optional mRequestorCanConsent; - chip::Optional mMetadataForProvider; +class SubscribeAttributeFlowMeasurementMinMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeFlowMeasurementMinMeasuredValue() + : SubscribeAttribute("min-measured-value") + { + } + + ~SubscribeAttributeFlowMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Attribute AttributeList + * Attribute MaxMeasuredValue */ -class ReadOtaSoftwareUpdateProviderAttributeList : public ReadAttribute { +class ReadFlowMeasurementMaxMeasuredValue : public ReadAttribute { public: - ReadOtaSoftwareUpdateProviderAttributeList() - : ReadAttribute("attribute-list") + ReadFlowMeasurementMaxMeasuredValue() + : ReadAttribute("max-measured-value") { } - ~ReadOtaSoftwareUpdateProviderAttributeList() {} + ~ReadFlowMeasurementMaxMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateProvider.AttributeList response %@", [value description]); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateProvider AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FlowMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -39266,37 +41975,35 @@ class ReadOtaSoftwareUpdateProviderAttributeList : public ReadAttribute { } }; -class SubscribeAttributeOtaSoftwareUpdateProviderAttributeList : public SubscribeAttribute { +class SubscribeAttributeFlowMeasurementMaxMeasuredValue : public SubscribeAttribute { public: - SubscribeAttributeOtaSoftwareUpdateProviderAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeFlowMeasurementMaxMeasuredValue() + : SubscribeAttribute("max-measured-value") { } - ~SubscribeAttributeOtaSoftwareUpdateProviderAttributeList() {} + ~SubscribeAttributeFlowMeasurementMaxMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateProvider.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39308,32 +42015,30 @@ class SubscribeAttributeOtaSoftwareUpdateProviderAttributeList : public Subscrib }; /* - * Attribute ClusterRevision + * Attribute Tolerance */ -class ReadOtaSoftwareUpdateProviderClusterRevision : public ReadAttribute { +class ReadFlowMeasurementTolerance : public ReadAttribute { public: - ReadOtaSoftwareUpdateProviderClusterRevision() - : ReadAttribute("cluster-revision") + ReadFlowMeasurementTolerance() + : ReadAttribute("tolerance") { } - ~ReadOtaSoftwareUpdateProviderClusterRevision() {} + ~ReadFlowMeasurementTolerance() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateProvider.ClusterRevision response %@", [value description]); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateProvider ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FlowMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -39341,37 +42046,34 @@ class ReadOtaSoftwareUpdateProviderClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision : public SubscribeAttribute { +class SubscribeAttributeFlowMeasurementTolerance : public SubscribeAttribute { public: - SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeFlowMeasurementTolerance() + : SubscribeAttribute("tolerance") { } - ~SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision() {} + ~SubscribeAttributeFlowMeasurementTolerance() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateProvider.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39382,216 +42084,133 @@ class SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision : public Subscr } }; -/*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateRequestor | 0x002A | -|------------------------------------------------------------------------------| -| Commands: | | -| * AnnounceOtaProvider | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * DefaultOtaProviders | 0x0000 | -| * UpdatePossible | 0x0001 | -| * UpdateState | 0x0002 | -| * UpdateStateProgress | 0x0003 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StateTransition | 0x0000 | -| * VersionApplied | 0x0001 | -| * DownloadError | 0x0002 | -\*----------------------------------------------------------------------------*/ - /* - * Command AnnounceOtaProvider + * Attribute GeneratedCommandList */ -class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ClusterCommand { +class ReadFlowMeasurementGeneratedCommandList : public ReadAttribute { public: - OtaSoftwareUpdateRequestorAnnounceOtaProvider() - : ClusterCommand("announce-ota-provider") + ReadFlowMeasurementGeneratedCommandList() + : ReadAttribute("generated-command-list") { - AddArgument("ProviderNodeId", 0, UINT64_MAX, &mProviderNodeId); - AddArgument("VendorId", 0, UINT16_MAX, &mVendorId); - AddArgument("AnnouncementReason", 0, UINT8_MAX, &mAnnouncementReason); - AddArgument("MetadataForNode", &mMetadataForNode); - AddArgument("Endpoint", 0, UINT16_MAX, &mEndpoint); - ClusterCommand::AddArguments(); } + ~ReadFlowMeasurementGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.providerNodeId = [NSNumber numberWithUnsignedLongLong:mProviderNodeId]; - params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; - params.announcementReason = [NSNumber numberWithUnsignedChar:mAnnouncementReason]; - if (mMetadataForNode.HasValue()) { - params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.Value().data() - length:mMetadataForNode.Value().size()]; - } - params.endpoint = [NSNumber numberWithUnsignedShort:mEndpoint]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster announceOtaProviderWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::NodeId mProviderNodeId; - chip::VendorId mVendorId; - uint8_t mAnnouncementReason; - chip::Optional mMetadataForNode; - chip::EndpointId mEndpoint; + if (error != nil) { + ChipLogError(chipTool, "FlowMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Attribute DefaultOtaProviders - */ -class ReadOtaSoftwareUpdateRequestorDefaultOtaProviders : public ReadAttribute { +class SubscribeAttributeFlowMeasurementGeneratedCommandList : public SubscribeAttribute { public: - ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() - : ReadAttribute("default-ota-providers") + SubscribeAttributeFlowMeasurementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() {} + ~SubscribeAttributeFlowMeasurementGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - readAttributeDefaultOtaProvidersWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.DefaultOtaProviders response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateRequestor DefaultOtaProviders read Error: %s", - chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } }; -class WriteOtaSoftwareUpdateRequestorDefaultOtaProviders : public WriteAttribute { +/* + * Attribute AcceptedCommandList + */ +class ReadFlowMeasurementAcceptedCommandList : public ReadAttribute { public: - WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() - : WriteAttribute("default-ota-providers") - , mComplex(&mValue) + ReadFlowMeasurementAcceptedCommandList() + : ReadAttribute("accepted-command-list") { - AddArgument("attr-name", "default-ota-providers"); - AddArgument("attr-value", &mComplex); - WriteAttribute::AddArguments(); } - ~WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() {} + ~ReadFlowMeasurementAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) WriteAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - CHIPOtaSoftwareUpdateRequestorClusterProviderLocation * newElement_0; - newElement_0 = [CHIPOtaSoftwareUpdateRequestorClusterProviderLocation new]; - newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; - newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - [cluster writeAttributeDefaultOtaProvidersWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "OtaSoftwareUpdateRequestor DefaultOtaProviders write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + if (error != nil) { + ChipLogError(chipTool, "FlowMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument< - chip::app::DataModel::List> - mComplex; }; -class SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders : public SubscribeAttribute { +class SubscribeAttributeFlowMeasurementAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders() - : SubscribeAttribute("default-ota-providers") + SubscribeAttributeFlowMeasurementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders() {} + ~SubscribeAttributeFlowMeasurementAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDefaultOtaProvidersWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.DefaultOtaProviders response %@", + NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -39608,32 +42227,30 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders : public S }; /* - * Attribute UpdatePossible + * Attribute AttributeList */ -class ReadOtaSoftwareUpdateRequestorUpdatePossible : public ReadAttribute { +class ReadFlowMeasurementAttributeList : public ReadAttribute { public: - ReadOtaSoftwareUpdateRequestorUpdatePossible() - : ReadAttribute("update-possible") + ReadFlowMeasurementAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadOtaSoftwareUpdateRequestorUpdatePossible() {} + ~ReadFlowMeasurementAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeUpdatePossibleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.UpdatePossible response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateRequestor UpdatePossible read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FlowMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -39641,37 +42258,34 @@ class ReadOtaSoftwareUpdateRequestorUpdatePossible : public ReadAttribute { } }; -class SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible : public SubscribeAttribute { +class SubscribeAttributeFlowMeasurementAttributeList : public SubscribeAttribute { public: - SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible() - : SubscribeAttribute("update-possible") + SubscribeAttributeFlowMeasurementAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible() {} + ~SubscribeAttributeFlowMeasurementAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeUpdatePossibleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.UpdatePossible response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39683,32 +42297,30 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible : public Subscr }; /* - * Attribute UpdateState + * Attribute FeatureMap */ -class ReadOtaSoftwareUpdateRequestorUpdateState : public ReadAttribute { +class ReadFlowMeasurementFeatureMap : public ReadAttribute { public: - ReadOtaSoftwareUpdateRequestorUpdateState() - : ReadAttribute("update-state") + ReadFlowMeasurementFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadOtaSoftwareUpdateRequestorUpdateState() {} + ~ReadFlowMeasurementFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeUpdateStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.UpdateState response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateRequestor UpdateState read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FlowMeasurement FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -39716,37 +42328,34 @@ class ReadOtaSoftwareUpdateRequestorUpdateState : public ReadAttribute { } }; -class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState : public SubscribeAttribute { +class SubscribeAttributeFlowMeasurementFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState() - : SubscribeAttribute("update-state") + SubscribeAttributeFlowMeasurementFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState() {} + ~SubscribeAttributeFlowMeasurementFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeUpdateStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.UpdateState response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39758,32 +42367,30 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState : public Subscribe }; /* - * Attribute UpdateStateProgress + * Attribute ClusterRevision */ -class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ReadAttribute { +class ReadFlowMeasurementClusterRevision : public ReadAttribute { public: - ReadOtaSoftwareUpdateRequestorUpdateStateProgress() - : ReadAttribute("update-state-progress") + ReadFlowMeasurementClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadOtaSoftwareUpdateRequestorUpdateStateProgress() {} + ~ReadFlowMeasurementClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeUpdateStateProgressWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.UpdateStateProgress response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateRequestor UpdateStateProgress read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "FlowMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -39791,37 +42398,34 @@ class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ReadAttribute { } }; -class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress : public SubscribeAttribute { +class SubscribeAttributeFlowMeasurementClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress() - : SubscribeAttribute("update-state-progress") + SubscribeAttributeFlowMeasurementClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress() {} + ~SubscribeAttributeFlowMeasurementClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeUpdateStateProgressWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.UpdateStateProgress response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39832,108 +42436,220 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress : public S } }; +/*----------------------------------------------------------------------------*\ +| Cluster GeneralCommissioning | 0x0030 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ArmFailSafe | 0x00 | +| * SetRegulatoryConfig | 0x02 | +| * CommissioningComplete | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Breadcrumb | 0x0000 | +| * BasicCommissioningInfo | 0x0001 | +| * RegulatoryConfig | 0x0002 | +| * LocationCapability | 0x0003 | +| * SupportsConcurrentConnection | 0x0004 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute AttributeList + * Command ArmFailSafe */ -class ReadOtaSoftwareUpdateRequestorAttributeList : public ReadAttribute { +class GeneralCommissioningArmFailSafe : public ClusterCommand { public: - ReadOtaSoftwareUpdateRequestorAttributeList() - : ReadAttribute("attribute-list") + GeneralCommissioningArmFailSafe() + : ClusterCommand("arm-fail-safe") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ExpiryLengthSeconds", 0, UINT16_MAX, &mExpiryLengthSeconds); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); + ClusterCommand::AddArguments(); } - ~ReadOtaSoftwareUpdateRequestorAttributeList() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.AttributeList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateRequestor AttributeList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:mExpiryLengthSeconds]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster armFailSafeWithParams:params + completionHandler:^(CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type mRequest; + uint16_t mExpiryLengthSeconds; + uint64_t mBreadcrumb; }; -class SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList : public SubscribeAttribute { +/* + * Command SetRegulatoryConfig + */ +class GeneralCommissioningSetRegulatoryConfig : public ClusterCommand { public: - SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList() - : SubscribeAttribute("attribute-list") + GeneralCommissioningSetRegulatoryConfig() + : ClusterCommand("set-regulatory-config") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NewRegulatoryConfig", 0, UINT8_MAX, &mNewRegulatoryConfig); + AddArgument("CountryCode", &mCountryCode); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.AttributeList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGeneralCommissioningClusterSetRegulatoryConfigParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.newRegulatoryConfig = [NSNumber numberWithUnsignedChar:mNewRegulatoryConfig]; + params.countryCode = [[NSString alloc] initWithBytes:mCountryCode.data() + length:mCountryCode.size() + encoding:NSUTF8StringEncoding]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + setRegulatoryConfigWithParams:params + completionHandler:^(CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type mRequest; + uint8_t mNewRegulatoryConfig; + chip::ByteSpan mCountryCode; + uint64_t mBreadcrumb; +}; + +/* + * Command CommissioningComplete + */ +class GeneralCommissioningCommissioningComplete : public ClusterCommand { +public: + GeneralCommissioningCommissioningComplete() + : ClusterCommand("commissioning-complete") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGeneralCommissioningClusterCommissioningCompleteParams 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 commissioningCompleteWithCompletionHandler:^( + CHIPGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type mRequest; }; /* - * Attribute ClusterRevision + * Attribute Breadcrumb */ -class ReadOtaSoftwareUpdateRequestorClusterRevision : public ReadAttribute { +class ReadGeneralCommissioningBreadcrumb : public ReadAttribute { public: - ReadOtaSoftwareUpdateRequestorClusterRevision() - : ReadAttribute("cluster-revision") + ReadGeneralCommissioningBreadcrumb() + : ReadAttribute("breadcrumb") { } - ~ReadOtaSoftwareUpdateRequestorClusterRevision() {} + ~ReadGeneralCommissioningBreadcrumb() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.ClusterRevision response %@", [value description]); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OtaSoftwareUpdateRequestor ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning Breadcrumb read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -39941,37 +42657,78 @@ class ReadOtaSoftwareUpdateRequestorClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision : public SubscribeAttribute { +class WriteGeneralCommissioningBreadcrumb : public WriteAttribute { public: - SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteGeneralCommissioningBreadcrumb() + : WriteAttribute("breadcrumb") { + AddArgument("attr-name", "breadcrumb"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision() {} + ~WriteGeneralCommissioningBreadcrumb() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) WriteAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + + [cluster writeAttributeBreadcrumbWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "GeneralCommissioning Breadcrumb write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint64_t mValue; +}; + +class SubscribeAttributeGeneralCommissioningBreadcrumb : public SubscribeAttribute { +public: + SubscribeAttributeGeneralCommissioningBreadcrumb() + : SubscribeAttribute("breadcrumb") + { + } + + ~SubscribeAttributeGeneralCommissioningBreadcrumb() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OtaSoftwareUpdateRequestor.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeBreadcrumbWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -39982,60 +42739,34 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision : public Subsc } }; -/*----------------------------------------------------------------------------*\ -| Cluster OccupancySensing | 0x0406 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Occupancy | 0x0000 | -| * OccupancySensorType | 0x0001 | -| * OccupancySensorTypeBitmap | 0x0002 | -| * PirOccupiedToUnoccupiedDelay | 0x0010 | -| * PirUnoccupiedToOccupiedDelay | 0x0011 | -| * PirUnoccupiedToOccupiedThreshold | 0x0012 | -| * UltrasonicOccupiedToUnoccupiedDelay | 0x0020 | -| * UltrasonicUnoccupiedToOccupiedDelay | 0x0021 | -| * UltrasonicUnoccupiedToOccupiedThreshold | 0x0022 | -| * PhysicalContactOccupiedToUnoccupiedDelay | 0x0030 | -| * PhysicalContactUnoccupiedToOccupiedDelay | 0x0031 | -| * PhysicalContactUnoccupiedToOccupiedThreshold | 0x0032 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute Occupancy + * Attribute BasicCommissioningInfo */ -class ReadOccupancySensingOccupancy : public ReadAttribute { +class ReadGeneralCommissioningBasicCommissioningInfo : public ReadAttribute { public: - ReadOccupancySensingOccupancy() - : ReadAttribute("occupancy") + ReadGeneralCommissioningBasicCommissioningInfo() + : ReadAttribute("basic-commissioning-info") { } - ~ReadOccupancySensingOccupancy() {} + ~ReadGeneralCommissioningBasicCommissioningInfo() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.Occupancy response %@", [value description]); + [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( + CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OccupancySensing Occupancy read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning BasicCommissioningInfo read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40043,36 +42774,40 @@ class ReadOccupancySensingOccupancy : public ReadAttribute { } }; -class SubscribeAttributeOccupancySensingOccupancy : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningBasicCommissioningInfo : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingOccupancy() - : SubscribeAttribute("occupancy") + SubscribeAttributeGeneralCommissioningBasicCommissioningInfo() + : SubscribeAttribute("basic-commissioning-info") { } - ~SubscribeAttributeOccupancySensingOccupancy() {} + ~SubscribeAttributeGeneralCommissioningBasicCommissioningInfo() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOccupancyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.Occupancy response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeBasicCommissioningInfoWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, + NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -40084,32 +42819,32 @@ class SubscribeAttributeOccupancySensingOccupancy : public SubscribeAttribute { }; /* - * Attribute OccupancySensorType + * Attribute RegulatoryConfig */ -class ReadOccupancySensingOccupancySensorType : public ReadAttribute { +class ReadGeneralCommissioningRegulatoryConfig : public ReadAttribute { public: - ReadOccupancySensingOccupancySensorType() - : ReadAttribute("occupancy-sensor-type") + ReadGeneralCommissioningRegulatoryConfig() + : ReadAttribute("regulatory-config") { } - ~ReadOccupancySensingOccupancySensorType() {} + ~ReadGeneralCommissioningRegulatoryConfig() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.OccupancySensorType response %@", [value description]); + [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OccupancySensing OccupancySensorType read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning RegulatoryConfig read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40117,37 +42852,37 @@ class ReadOccupancySensingOccupancySensorType : public ReadAttribute { } }; -class SubscribeAttributeOccupancySensingOccupancySensorType : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningRegulatoryConfig : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingOccupancySensorType() - : SubscribeAttribute("occupancy-sensor-type") + SubscribeAttributeGeneralCommissioningRegulatoryConfig() + : SubscribeAttribute("regulatory-config") { } - ~SubscribeAttributeOccupancySensingOccupancySensorType() {} + ~SubscribeAttributeGeneralCommissioningRegulatoryConfig() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOccupancySensorTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.OccupancySensorType response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRegulatoryConfigWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -40159,72 +42894,148 @@ class SubscribeAttributeOccupancySensingOccupancySensorType : public SubscribeAt }; /* - * Attribute OccupancySensorTypeBitmap + * Attribute LocationCapability */ -class ReadOccupancySensingOccupancySensorTypeBitmap : public ReadAttribute { +class ReadGeneralCommissioningLocationCapability : public ReadAttribute { public: - ReadOccupancySensingOccupancySensorTypeBitmap() - : ReadAttribute("occupancy-sensor-type-bitmap") + ReadGeneralCommissioningLocationCapability() + : ReadAttribute("location-capability") { } - ~ReadOccupancySensingOccupancySensorTypeBitmap() {} + ~ReadGeneralCommissioningLocationCapability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.LocationCapability response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OccupancySensing OccupancySensorTypeBitmap read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "GeneralCommissioning LocationCapability read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningLocationCapability : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap() - : SubscribeAttribute("occupancy-sensor-type-bitmap") + SubscribeAttributeGeneralCommissioningLocationCapability() + : SubscribeAttribute("location-capability") { } - ~SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap() {} + ~SubscribeAttributeGeneralCommissioningLocationCapability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLocationCapabilityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.LocationCapability response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute SupportsConcurrentConnection + */ +class ReadGeneralCommissioningSupportsConcurrentConnection : public ReadAttribute { +public: + ReadGeneralCommissioningSupportsConcurrentConnection() + : ReadAttribute("supports-concurrent-connection") + { + } + + ~ReadGeneralCommissioningSupportsConcurrentConnection() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSupportsConcurrentConnectionWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "GeneralCommissioning SupportsConcurrentConnection read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection : public SubscribeAttribute { +public: + SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection() + : SubscribeAttribute("supports-concurrent-connection") + { + } + + ~SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeOccupancySensorTypeBitmapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeSupportsConcurrentConnectionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response " + @"%@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -40238,30 +43049,30 @@ class SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap : public Subsc /* * Attribute GeneratedCommandList */ -class ReadOccupancySensingGeneratedCommandList : public ReadAttribute { +class ReadGeneralCommissioningGeneratedCommandList : public ReadAttribute { public: - ReadOccupancySensingGeneratedCommandList() + ReadGeneralCommissioningGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadOccupancySensingGeneratedCommandList() {} + ~ReadGeneralCommissioningGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.GeneratedCommandList response %@", [value description]); + NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OccupancySensing GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40269,22 +43080,22 @@ class ReadOccupancySensingGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeOccupancySensingGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingGeneratedCommandList() + SubscribeAttributeGeneralCommissioningGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeOccupancySensingGeneratedCommandList() {} + ~SubscribeAttributeGeneralCommissioningGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -40294,7 +43105,7 @@ class SubscribeAttributeOccupancySensingGeneratedCommandList : public SubscribeA params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.GeneratedCommandList response %@", + NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -40313,30 +43124,30 @@ class SubscribeAttributeOccupancySensingGeneratedCommandList : public SubscribeA /* * Attribute AcceptedCommandList */ -class ReadOccupancySensingAcceptedCommandList : public ReadAttribute { +class ReadGeneralCommissioningAcceptedCommandList : public ReadAttribute { public: - ReadOccupancySensingAcceptedCommandList() + ReadGeneralCommissioningAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadOccupancySensingAcceptedCommandList() {} + ~ReadGeneralCommissioningAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.AcceptedCommandList response %@", [value description]); + NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OccupancySensing AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40344,22 +43155,22 @@ class ReadOccupancySensingAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeOccupancySensingAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingAcceptedCommandList() + SubscribeAttributeGeneralCommissioningAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeOccupancySensingAcceptedCommandList() {} + ~SubscribeAttributeGeneralCommissioningAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -40369,7 +43180,7 @@ class SubscribeAttributeOccupancySensingAcceptedCommandList : public SubscribeAt params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.AcceptedCommandList response %@", + NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -40388,30 +43199,30 @@ class SubscribeAttributeOccupancySensingAcceptedCommandList : public SubscribeAt /* * Attribute AttributeList */ -class ReadOccupancySensingAttributeList : public ReadAttribute { +class ReadGeneralCommissioningAttributeList : public ReadAttribute { public: - ReadOccupancySensingAttributeList() + ReadGeneralCommissioningAttributeList() : ReadAttribute("attribute-list") { } - ~ReadOccupancySensingAttributeList() {} + ~ReadGeneralCommissioningAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.AttributeList response %@", [value description]); + NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OccupancySensing AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40419,22 +43230,22 @@ class ReadOccupancySensingAttributeList : public ReadAttribute { } }; -class SubscribeAttributeOccupancySensingAttributeList : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningAttributeList : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingAttributeList() + SubscribeAttributeGeneralCommissioningAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeOccupancySensingAttributeList() {} + ~SubscribeAttributeGeneralCommissioningAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -40444,7 +43255,7 @@ class SubscribeAttributeOccupancySensingAttributeList : public SubscribeAttribut params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.AttributeList response %@", [value description]); + NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -40459,33 +43270,107 @@ class SubscribeAttributeOccupancySensingAttributeList : public SubscribeAttribut } }; +/* + * Attribute FeatureMap + */ +class ReadGeneralCommissioningFeatureMap : public ReadAttribute { +public: + ReadGeneralCommissioningFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadGeneralCommissioningFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "GeneralCommissioning FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeGeneralCommissioningFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeGeneralCommissioningFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeGeneralCommissioningFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ -class ReadOccupancySensingClusterRevision : public ReadAttribute { +class ReadGeneralCommissioningClusterRevision : public ReadAttribute { public: - ReadOccupancySensingClusterRevision() + ReadGeneralCommissioningClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadOccupancySensingClusterRevision() {} + ~ReadGeneralCommissioningClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); + NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OccupancySensing ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralCommissioning ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40493,36 +43378,37 @@ class ReadOccupancySensingClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeOccupancySensingClusterRevision : public SubscribeAttribute { +class SubscribeAttributeGeneralCommissioningClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeOccupancySensingClusterRevision() + SubscribeAttributeGeneralCommissioningClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeOccupancySensingClusterRevision() {} + ~SubscribeAttributeGeneralCommissioningClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -40534,22 +43420,19 @@ class SubscribeAttributeOccupancySensingClusterRevision : public SubscribeAttrib }; /*----------------------------------------------------------------------------*\ -| Cluster OnOff | 0x0006 | +| Cluster GeneralDiagnostics | 0x0033 | |------------------------------------------------------------------------------| | Commands: | | -| * Off | 0x00 | -| * On | 0x01 | -| * Toggle | 0x02 | -| * OffWithEffect | 0x40 | -| * OnWithRecallGlobalScene | 0x41 | -| * OnWithTimedOff | 0x42 | |------------------------------------------------------------------------------| | Attributes: | | -| * OnOff | 0x0000 | -| * GlobalSceneControl | 0x4000 | -| * OnTime | 0x4001 | -| * OffWaitTime | 0x4002 | -| * StartUpOnOff | 0x4003 | +| * NetworkInterfaces | 0x0000 | +| * RebootCount | 0x0001 | +| * UpTime | 0x0002 | +| * TotalOperationalHours | 0x0003 | +| * BootReasons | 0x0004 | +| * ActiveHardwareFaults | 0x0005 | +| * ActiveRadioFaults | 0x0006 | +| * ActiveNetworkFaults | 0x0007 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -40557,302 +43440,114 @@ class SubscribeAttributeOccupancySensingClusterRevision : public SubscribeAttrib | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * HardwareFaultChange | 0x0000 | +| * RadioFaultChange | 0x0001 | +| * NetworkFaultChange | 0x0002 | +| * BootReason | 0x0003 | \*----------------------------------------------------------------------------*/ /* - * Command Off + * Attribute NetworkInterfaces */ -class OnOffOff : public ClusterCommand { +class ReadGeneralDiagnosticsNetworkInterfaces : public ReadAttribute { public: - OnOffOff() - : ClusterCommand("off") + ReadGeneralDiagnosticsNetworkInterfaces() + : ReadAttribute("network-interfaces") { - ClusterCommand::AddArguments(); } + ~ReadGeneralDiagnosticsNetworkInterfaces() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOnOffClusterOffParams 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 offWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "GeneralDiagnostics NetworkInterfaces read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command OffWithEffect - */ -class OnOffOffWithEffect : public ClusterCommand { +class SubscribeAttributeGeneralDiagnosticsNetworkInterfaces : public SubscribeAttribute { public: - OnOffOffWithEffect() - : ClusterCommand("off-with-effect") + SubscribeAttributeGeneralDiagnosticsNetworkInterfaces() + : SubscribeAttribute("network-interfaces") { - AddArgument("EffectId", 0, UINT8_MAX, &mEffectId); - AddArgument("EffectVariant", 0, UINT8_MAX, &mEffectVariant); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeGeneralDiagnosticsNetworkInterfaces() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000040) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOnOffClusterOffWithEffectParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.effectId = [NSNumber numberWithUnsignedChar:mEffectId]; - params.effectVariant = [NSNumber numberWithUnsignedChar:mEffectVariant]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster offWithEffectWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mEffectId; - uint8_t mEffectVariant; -}; - -/* - * Command On - */ -class OnOffOn : public ClusterCommand { -public: - OnOffOn() - : ClusterCommand("on") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOnOffClusterOnParams 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 onWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: -}; - -/* - * Command OnWithRecallGlobalScene - */ -class OnOffOnWithRecallGlobalScene : public ClusterCommand { -public: - OnOffOnWithRecallGlobalScene() - : ClusterCommand("on-with-recall-global-scene") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000041) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOnOffClusterOnWithRecallGlobalSceneParams 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 onWithRecallGlobalSceneWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: -}; - -/* - * Command OnWithTimedOff - */ -class OnOffOnWithTimedOff : public ClusterCommand { -public: - OnOffOnWithTimedOff() - : ClusterCommand("on-with-timed-off") - { - AddArgument("OnOffControl", 0, UINT8_MAX, &mOnOffControl); - AddArgument("OnTime", 0, UINT16_MAX, &mOnTime); - AddArgument("OffWaitTime", 0, UINT16_MAX, &mOffWaitTime); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000042) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOnOffClusterOnWithTimedOffParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.onOffControl = [NSNumber numberWithUnsignedChar:mOnOffControl]; - params.onTime = [NSNumber numberWithUnsignedShort:mOnTime]; - params.offWaitTime = [NSNumber numberWithUnsignedShort:mOffWaitTime]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster onWithTimedOffWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - uint8_t mOnOffControl; - uint16_t mOnTime; - uint16_t mOffWaitTime; -}; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeNetworkInterfacesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; -/* - * Command Toggle - */ -class OnOffToggle : public ClusterCommand { -public: - OnOffToggle() - : ClusterCommand("toggle") - { - ClusterCommand::AddArguments(); + return CHIP_NO_ERROR; } - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + chip::System::Clock::Timeout GetWaitDuration() const override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOnOffClusterToggleParams 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 toggleWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - -private: }; /* - * Attribute OnOff + * Attribute RebootCount */ -class ReadOnOffOnOff : public ReadAttribute { +class ReadGeneralDiagnosticsRebootCount : public ReadAttribute { public: - ReadOnOffOnOff() - : ReadAttribute("on-off") + ReadGeneralDiagnosticsRebootCount() + : ReadAttribute("reboot-count") { } - ~ReadOnOffOnOff() {} + ~ReadGeneralDiagnosticsRebootCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.OnOff response %@", [value description]); + [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff OnOff read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics RebootCount read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40860,34 +43555,36 @@ class ReadOnOffOnOff : public ReadAttribute { } }; -class SubscribeAttributeOnOffOnOff : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsRebootCount : public SubscribeAttribute { public: - SubscribeAttributeOnOffOnOff() - : SubscribeAttribute("on-off") + SubscribeAttributeGeneralDiagnosticsRebootCount() + : SubscribeAttribute("reboot-count") { } - ~SubscribeAttributeOnOffOnOff() {} + ~SubscribeAttributeGeneralDiagnosticsRebootCount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.OnOff response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRebootCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -40899,30 +43596,32 @@ class SubscribeAttributeOnOffOnOff : public SubscribeAttribute { }; /* - * Attribute GlobalSceneControl + * Attribute UpTime */ -class ReadOnOffGlobalSceneControl : public ReadAttribute { +class ReadGeneralDiagnosticsUpTime : public ReadAttribute { public: - ReadOnOffGlobalSceneControl() - : ReadAttribute("global-scene-control") + ReadGeneralDiagnosticsUpTime() + : ReadAttribute("up-time") { } - ~ReadOnOffGlobalSceneControl() {} + ~ReadGeneralDiagnosticsUpTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); + [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff GlobalSceneControl read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics UpTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -40930,34 +43629,36 @@ class ReadOnOffGlobalSceneControl : public ReadAttribute { } }; -class SubscribeAttributeOnOffGlobalSceneControl : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsUpTime : public SubscribeAttribute { public: - SubscribeAttributeOnOffGlobalSceneControl() - : SubscribeAttribute("global-scene-control") + SubscribeAttributeGeneralDiagnosticsUpTime() + : SubscribeAttribute("up-time") { } - ~SubscribeAttributeOnOffGlobalSceneControl() {} + ~SubscribeAttributeGeneralDiagnosticsUpTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGlobalSceneControlWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeUpTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -40969,30 +43670,32 @@ class SubscribeAttributeOnOffGlobalSceneControl : public SubscribeAttribute { }; /* - * Attribute OnTime + * Attribute TotalOperationalHours */ -class ReadOnOffOnTime : public ReadAttribute { +class ReadGeneralDiagnosticsTotalOperationalHours : public ReadAttribute { public: - ReadOnOffOnTime() - : ReadAttribute("on-time") + ReadGeneralDiagnosticsTotalOperationalHours() + : ReadAttribute("total-operational-hours") { } - ~ReadOnOffOnTime() {} + ~ReadGeneralDiagnosticsTotalOperationalHours() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.OnTime response %@", [value description]); + [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff OnTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics TotalOperationalHours read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41000,73 +43703,37 @@ class ReadOnOffOnTime : public ReadAttribute { } }; -class WriteOnOffOnTime : public WriteAttribute { -public: - WriteOnOffOnTime() - : WriteAttribute("on-time") - { - AddArgument("attr-name", "on-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteOnOffOnTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004001) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster writeAttributeOnTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OnOff OnTime write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeOnOffOnTime : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsTotalOperationalHours : public SubscribeAttribute { public: - SubscribeAttributeOnOffOnTime() - : SubscribeAttribute("on-time") + SubscribeAttributeGeneralDiagnosticsTotalOperationalHours() + : SubscribeAttribute("total-operational-hours") { } - ~SubscribeAttributeOnOffOnTime() {} + ~SubscribeAttributeGeneralDiagnosticsTotalOperationalHours() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOnTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.OnTime response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeTotalOperationalHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41078,30 +43745,32 @@ class SubscribeAttributeOnOffOnTime : public SubscribeAttribute { }; /* - * Attribute OffWaitTime + * Attribute BootReasons */ -class ReadOnOffOffWaitTime : public ReadAttribute { +class ReadGeneralDiagnosticsBootReasons : public ReadAttribute { public: - ReadOnOffOffWaitTime() - : ReadAttribute("off-wait-time") + ReadGeneralDiagnosticsBootReasons() + : ReadAttribute("boot-reasons") { } - ~ReadOnOffOffWaitTime() {} + ~ReadGeneralDiagnosticsBootReasons() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.OffWaitTime response %@", [value description]); + [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.BootReasons response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff OffWaitTime read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics BootReasons read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41109,69 +43778,32 @@ class ReadOnOffOffWaitTime : public ReadAttribute { } }; -class WriteOnOffOffWaitTime : public WriteAttribute { -public: - WriteOnOffOffWaitTime() - : WriteAttribute("off-wait-time") - { - AddArgument("attr-name", "off-wait-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteOnOffOffWaitTime() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004002) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster writeAttributeOffWaitTimeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OnOff OffWaitTime write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeOnOffOffWaitTime : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsBootReasons : public SubscribeAttribute { public: - SubscribeAttributeOnOffOffWaitTime() - : SubscribeAttribute("off-wait-time") + SubscribeAttributeGeneralDiagnosticsBootReasons() + : SubscribeAttribute("boot-reasons") { } - ~SubscribeAttributeOnOffOffWaitTime() {} + ~SubscribeAttributeGeneralDiagnosticsBootReasons() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOffWaitTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeBootReasonsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.OffWaitTime response %@", [value description]); + NSLog(@"GeneralDiagnostics.BootReasons response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -41187,30 +43819,32 @@ class SubscribeAttributeOnOffOffWaitTime : public SubscribeAttribute { }; /* - * Attribute StartUpOnOff + * Attribute ActiveHardwareFaults */ -class ReadOnOffStartUpOnOff : public ReadAttribute { +class ReadGeneralDiagnosticsActiveHardwareFaults : public ReadAttribute { public: - ReadOnOffStartUpOnOff() - : ReadAttribute("start-up-on-off") + ReadGeneralDiagnosticsActiveHardwareFaults() + : ReadAttribute("active-hardware-faults") { } - ~ReadOnOffStartUpOnOff() {} + ~ReadGeneralDiagnosticsActiveHardwareFaults() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.StartUpOnOff response %@", [value description]); + [cluster readAttributeActiveHardwareFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff StartUpOnOff read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics ActiveHardwareFaults read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41218,73 +43852,37 @@ class ReadOnOffStartUpOnOff : public ReadAttribute { } }; -class WriteOnOffStartUpOnOff : public WriteAttribute { +class SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults : public SubscribeAttribute { public: - WriteOnOffStartUpOnOff() - : WriteAttribute("start-up-on-off") + SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults() + : SubscribeAttribute("active-hardware-faults") { - AddArgument("attr-name", "start-up-on-off"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); } - ~WriteOnOffStartUpOnOff() {} + ~SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeStartUpOnOffWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OnOff StartUpOnOff write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { -public: - SubscribeAttributeOnOffStartUpOnOff() - : SubscribeAttribute("start-up-on-off") - { - } - - ~SubscribeAttributeOnOffStartUpOnOff() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004003) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStartUpOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.StartUpOnOff response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActiveHardwareFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41296,30 +43894,32 @@ class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute ActiveRadioFaults */ -class ReadOnOffGeneratedCommandList : public ReadAttribute { +class ReadGeneralDiagnosticsActiveRadioFaults : public ReadAttribute { public: - ReadOnOffGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadGeneralDiagnosticsActiveRadioFaults() + : ReadAttribute("active-radio-faults") { } - ~ReadOnOffGeneratedCommandList() {} + ~ReadGeneralDiagnosticsActiveRadioFaults() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); + [cluster readAttributeActiveRadioFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics ActiveRadioFaults read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41327,34 +43927,37 @@ class ReadOnOffGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeOnOffGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsActiveRadioFaults : public SubscribeAttribute { public: - SubscribeAttributeOnOffGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeGeneralDiagnosticsActiveRadioFaults() + : SubscribeAttribute("active-radio-faults") { } - ~SubscribeAttributeOnOffGeneratedCommandList() {} + ~SubscribeAttributeGeneralDiagnosticsActiveRadioFaults() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeActiveRadioFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41366,30 +43969,32 @@ class SubscribeAttributeOnOffGeneratedCommandList : public SubscribeAttribute { }; /* - * Attribute AcceptedCommandList + * Attribute ActiveNetworkFaults */ -class ReadOnOffAcceptedCommandList : public ReadAttribute { +class ReadGeneralDiagnosticsActiveNetworkFaults : public ReadAttribute { public: - ReadOnOffAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadGeneralDiagnosticsActiveNetworkFaults() + : ReadAttribute("active-network-faults") { } - ~ReadOnOffAcceptedCommandList() {} + ~ReadGeneralDiagnosticsActiveNetworkFaults() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); + [cluster readAttributeActiveNetworkFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics ActiveNetworkFaults read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41397,30 +44002,33 @@ class ReadOnOffAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeOnOffAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults : public SubscribeAttribute { public: - SubscribeAttributeOnOffAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults() + : SubscribeAttribute("active-network-faults") { } - ~SubscribeAttributeOnOffAcceptedCommandList() {} + ~SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeActiveNetworkFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); + NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -41436,30 +44044,32 @@ class SubscribeAttributeOnOffAcceptedCommandList : public SubscribeAttribute { }; /* - * Attribute AttributeList + * Attribute GeneratedCommandList */ -class ReadOnOffAttributeList : public ReadAttribute { +class ReadGeneralDiagnosticsGeneratedCommandList : public ReadAttribute { public: - ReadOnOffAttributeList() - : ReadAttribute("attribute-list") + ReadGeneralDiagnosticsGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadOnOffAttributeList() {} + ~ReadGeneralDiagnosticsGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.AttributeList response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41467,34 +44077,37 @@ class ReadOnOffAttributeList : public ReadAttribute { } }; -class SubscribeAttributeOnOffAttributeList : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOnOffAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeGeneralDiagnosticsGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeOnOffAttributeList() {} + ~SubscribeAttributeGeneralDiagnosticsGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41506,30 +44119,32 @@ class SubscribeAttributeOnOffAttributeList : public SubscribeAttribute { }; /* - * Attribute FeatureMap + * Attribute AcceptedCommandList */ -class ReadOnOffFeatureMap : public ReadAttribute { +class ReadGeneralDiagnosticsAcceptedCommandList : public ReadAttribute { public: - ReadOnOffFeatureMap() - : ReadAttribute("feature-map") + ReadGeneralDiagnosticsAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadOnOffFeatureMap() {} + ~ReadGeneralDiagnosticsAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.FeatureMap response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41537,34 +44152,37 @@ class ReadOnOffFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeOnOffFeatureMap : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOnOffFeatureMap() - : SubscribeAttribute("feature-map") + SubscribeAttributeGeneralDiagnosticsAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeOnOffFeatureMap() {} + ~SubscribeAttributeGeneralDiagnosticsAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.FeatureMap response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41576,30 +44194,32 @@ class SubscribeAttributeOnOffFeatureMap : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute AttributeList */ -class ReadOnOffClusterRevision : public ReadAttribute { +class ReadGeneralDiagnosticsAttributeList : public ReadAttribute { public: - ReadOnOffClusterRevision() - : ReadAttribute("cluster-revision") + ReadGeneralDiagnosticsAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadOnOffClusterRevision() {} + ~ReadGeneralDiagnosticsAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.ClusterRevision response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOff ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41607,34 +44227,36 @@ class ReadOnOffClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeOnOffClusterRevision : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsAttributeList : public SubscribeAttribute { public: - SubscribeAttributeOnOffClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeGeneralDiagnosticsAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeOnOffClusterRevision() {} + ~SubscribeAttributeGeneralDiagnosticsAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOff.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41645,50 +44267,33 @@ class SubscribeAttributeOnOffClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster OnOffSwitchConfiguration | 0x0007 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * SwitchType | 0x0000 | -| * SwitchActions | 0x0010 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute SwitchType + * Attribute FeatureMap */ -class ReadOnOffSwitchConfigurationSwitchType : public ReadAttribute { +class ReadGeneralDiagnosticsFeatureMap : public ReadAttribute { public: - ReadOnOffSwitchConfigurationSwitchType() - : ReadAttribute("switch-type") + ReadGeneralDiagnosticsFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadOnOffSwitchConfigurationSwitchType() {} + ~ReadGeneralDiagnosticsFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSwitchTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchType read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41696,32 +44301,32 @@ class ReadOnOffSwitchConfigurationSwitchType : public ReadAttribute { } }; -class SubscribeAttributeOnOffSwitchConfigurationSwitchType : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeOnOffSwitchConfigurationSwitchType() - : SubscribeAttribute("switch-type") + SubscribeAttributeGeneralDiagnosticsFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeOnOffSwitchConfigurationSwitchType() {} + ~SubscribeAttributeGeneralDiagnosticsFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSwitchTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); + NSLog(@"GeneralDiagnostics.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -41737,32 +44342,32 @@ class SubscribeAttributeOnOffSwitchConfigurationSwitchType : public SubscribeAtt }; /* - * Attribute SwitchActions + * Attribute ClusterRevision */ -class ReadOnOffSwitchConfigurationSwitchActions : public ReadAttribute { +class ReadGeneralDiagnosticsClusterRevision : public ReadAttribute { public: - ReadOnOffSwitchConfigurationSwitchActions() - : ReadAttribute("switch-actions") + ReadGeneralDiagnosticsClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadOnOffSwitchConfigurationSwitchActions() {} + ~ReadGeneralDiagnosticsClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSwitchActionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchActions read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GeneralDiagnostics ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -41770,79 +44375,37 @@ class ReadOnOffSwitchConfigurationSwitchActions : public ReadAttribute { } }; -class WriteOnOffSwitchConfigurationSwitchActions : public WriteAttribute { -public: - WriteOnOffSwitchConfigurationSwitchActions() - : WriteAttribute("switch-actions") - { - AddArgument("attr-name", "switch-actions"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteOnOffSwitchConfigurationSwitchActions() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) WriteAttribute (0x00000010) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeSwitchActionsWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchActions write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeOnOffSwitchConfigurationSwitchActions : public SubscribeAttribute { +class SubscribeAttributeGeneralDiagnosticsClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeOnOffSwitchConfigurationSwitchActions() - : SubscribeAttribute("switch-actions") + SubscribeAttributeGeneralDiagnosticsClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeOnOffSwitchConfigurationSwitchActions() {} + ~SubscribeAttributeGeneralDiagnosticsClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeSwitchActionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -41853,146 +44416,406 @@ class SubscribeAttributeOnOffSwitchConfigurationSwitchActions : public Subscribe } }; +/*----------------------------------------------------------------------------*\ +| Cluster GroupKeyManagement | 0x003F | +|------------------------------------------------------------------------------| +| Commands: | | +| * KeySetWrite | 0x00 | +| * KeySetRead | 0x01 | +| * KeySetRemove | 0x03 | +| * KeySetReadAllIndices | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GroupKeyMap | 0x0000 | +| * GroupTable | 0x0001 | +| * MaxGroupsPerFabric | 0x0002 | +| * MaxGroupKeysPerFabric | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute GeneratedCommandList + * Command KeySetWrite */ -class ReadOnOffSwitchConfigurationGeneratedCommandList : public ReadAttribute { +class GroupKeyManagementKeySetWrite : public ClusterCommand { public: - ReadOnOffSwitchConfigurationGeneratedCommandList() - : ReadAttribute("generated-command-list") - { - } - - ~ReadOnOffSwitchConfigurationGeneratedCommandList() {} + GroupKeyManagementKeySetWrite() + : ClusterCommand("key-set-write") + , mComplex_GroupKeySet(&mRequest.groupKeySet) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupKeySet", &mComplex_GroupKeySet); + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration GeneratedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySetStruct new]; + params.groupKeySet.groupKeySetID = [NSNumber numberWithUnsignedShort:mRequest.groupKeySet.groupKeySetID]; + params.groupKeySet.groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.groupKeySet.groupKeySecurityPolicy)]; + if (mRequest.groupKeySet.epochKey0.IsNull()) { + params.groupKeySet.epochKey0 = nil; + } else { + params.groupKeySet.epochKey0 = [NSData dataWithBytes:mRequest.groupKeySet.epochKey0.Value().data() + length:mRequest.groupKeySet.epochKey0.Value().size()]; + } + if (mRequest.groupKeySet.epochStartTime0.IsNull()) { + params.groupKeySet.epochStartTime0 = nil; + } else { + params.groupKeySet.epochStartTime0 = [NSNumber numberWithUnsignedLongLong:mRequest.groupKeySet.epochStartTime0.Value()]; + } + if (mRequest.groupKeySet.epochKey1.IsNull()) { + params.groupKeySet.epochKey1 = nil; + } else { + params.groupKeySet.epochKey1 = [NSData dataWithBytes:mRequest.groupKeySet.epochKey1.Value().data() + length:mRequest.groupKeySet.epochKey1.Value().size()]; + } + if (mRequest.groupKeySet.epochStartTime1.IsNull()) { + params.groupKeySet.epochStartTime1 = nil; + } else { + params.groupKeySet.epochStartTime1 = [NSNumber numberWithUnsignedLongLong:mRequest.groupKeySet.epochStartTime1.Value()]; + } + if (mRequest.groupKeySet.epochKey2.IsNull()) { + params.groupKeySet.epochKey2 = nil; + } else { + params.groupKeySet.epochKey2 = [NSData dataWithBytes:mRequest.groupKeySet.epochKey2.Value().data() + length:mRequest.groupKeySet.epochKey2.Value().size()]; + } + if (mRequest.groupKeySet.epochStartTime2.IsNull()) { + params.groupKeySet.epochStartTime2 = nil; + } else { + params.groupKeySet.epochStartTime2 = [NSNumber numberWithUnsignedLongLong:mRequest.groupKeySet.epochStartTime2.Value()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; + TypedComplexArgument mComplex_GroupKeySet; }; -class SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList : public SubscribeAttribute { +/* + * Command KeySetRead + */ +class GroupKeyManagementKeySetRead : public ClusterCommand { public: - SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + GroupKeyManagementKeySetRead() + : ClusterCommand("key-set-read") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupKeySetID", 0, UINT16_MAX, &mGroupKeySetID); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:mGroupKeySetID]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster keySetReadWithParams:params + completionHandler:^( + CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type mRequest; + uint16_t mGroupKeySetID; +}; + +/* + * Command KeySetRemove + */ +class GroupKeyManagementKeySetRemove : public ClusterCommand { +public: + GroupKeyManagementKeySetRemove() + : ClusterCommand("key-set-remove") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupKeySetID", 0, UINT16_MAX, &mGroupKeySetID); + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:mGroupKeySetID]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type mRequest; + uint16_t mGroupKeySetID; +}; + +/* + * Command KeySetReadAllIndices + */ +class GroupKeyManagementKeySetReadAllIndices : public ClusterCommand { +public: + GroupKeyManagementKeySetReadAllIndices() + : ClusterCommand("key-set-read-all-indices") + , mComplex_GroupKeySetIDs(&mRequest.groupKeySetIDs) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupKeySetIDs", &mComplex_GroupKeySetIDs); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.groupKeySetIDs) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + params.groupKeySetIDs = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + keySetReadAllIndicesWithParams:params + completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type mRequest; + TypedComplexArgument> mComplex_GroupKeySetIDs; }; /* - * Attribute AcceptedCommandList + * Attribute GroupKeyMap */ -class ReadOnOffSwitchConfigurationAcceptedCommandList : public ReadAttribute { +class ReadGroupKeyManagementGroupKeyMap : public ReadAttribute { public: - ReadOnOffSwitchConfigurationAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadGroupKeyManagementGroupKeyMap() + : ReadAttribute("group-key-map") { } - ~ReadOnOffSwitchConfigurationAcceptedCommandList() {} + ~ReadGroupKeyManagementGroupKeyMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + readAttributeGroupKeyMapWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration AcceptedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement GroupKeyMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList : public SubscribeAttribute { +class WriteGroupKeyManagementGroupKeyMap : public WriteAttribute { public: - SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteGroupKeyManagementGroupKeyMap() + : WriteAttribute("group-key-map") + , mComplex(&mValue) { + AddArgument("attr-name", "group-key-map"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList() {} + ~WriteGroupKeyManagementGroupKeyMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) WriteAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupKeyMapStruct new]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeGroupKeyMapWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement GroupKeyMap write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; +}; + +class SubscribeAttributeGroupKeyManagementGroupKeyMap : public SubscribeAttribute { +public: + SubscribeAttributeGroupKeyManagementGroupKeyMap() + : SubscribeAttribute("group-key-map") + { + } + + ~SubscribeAttributeGroupKeyManagementGroupKeyMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGroupKeyMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -42004,70 +44827,73 @@ class SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList : public Sub }; /* - * Attribute AttributeList + * Attribute GroupTable */ -class ReadOnOffSwitchConfigurationAttributeList : public ReadAttribute { +class ReadGroupKeyManagementGroupTable : public ReadAttribute { public: - ReadOnOffSwitchConfigurationAttributeList() - : ReadAttribute("attribute-list") + ReadGroupKeyManagementGroupTable() + : ReadAttribute("group-table") { } - ~ReadOnOffSwitchConfigurationAttributeList() {} + ~ReadGroupKeyManagementGroupTable() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + readAttributeGroupTableWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration AttributeList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement GroupTable read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeOnOffSwitchConfigurationAttributeList : public SubscribeAttribute { +class SubscribeAttributeGroupKeyManagementGroupTable : public SubscribeAttribute { public: - SubscribeAttributeOnOffSwitchConfigurationAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeGroupKeyManagementGroupTable() + : SubscribeAttribute("group-table") { } - ~SubscribeAttributeOnOffSwitchConfigurationAttributeList() {} + ~SubscribeAttributeGroupKeyManagementGroupTable() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGroupTableWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -42079,32 +44905,32 @@ class SubscribeAttributeOnOffSwitchConfigurationAttributeList : public Subscribe }; /* - * Attribute ClusterRevision + * Attribute MaxGroupsPerFabric */ -class ReadOnOffSwitchConfigurationClusterRevision : public ReadAttribute { +class ReadGroupKeyManagementMaxGroupsPerFabric : public ReadAttribute { public: - ReadOnOffSwitchConfigurationClusterRevision() - : ReadAttribute("cluster-revision") + ReadGroupKeyManagementMaxGroupsPerFabric() + : ReadAttribute("max-groups-per-fabric") { } - ~ReadOnOffSwitchConfigurationClusterRevision() {} + ~ReadGroupKeyManagementMaxGroupsPerFabric() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", [value description]); + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OnOffSwitchConfiguration ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GroupKeyManagement MaxGroupsPerFabric read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -42112,37 +44938,37 @@ class ReadOnOffSwitchConfigurationClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeOnOffSwitchConfigurationClusterRevision : public SubscribeAttribute { +class SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric : public SubscribeAttribute { public: - SubscribeAttributeOnOffSwitchConfigurationClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric() + : SubscribeAttribute("max-groups-per-fabric") { } - ~SubscribeAttributeOnOffSwitchConfigurationClusterRevision() {} + ~SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMaxGroupsPerFabricWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -42153,570 +44979,295 @@ class SubscribeAttributeOnOffSwitchConfigurationClusterRevision : public Subscri } }; -/*----------------------------------------------------------------------------*\ -| Cluster OperationalCredentials | 0x003E | -|------------------------------------------------------------------------------| -| Commands: | | -| * AttestationRequest | 0x00 | -| * CertificateChainRequest | 0x02 | -| * CSRRequest | 0x04 | -| * AddNOC | 0x06 | -| * UpdateNOC | 0x07 | -| * UpdateFabricLabel | 0x09 | -| * RemoveFabric | 0x0A | -| * AddTrustedRootCertificate | 0x0B | -| * RemoveTrustedRootCertificate | 0x0C | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NOCs | 0x0000 | -| * Fabrics | 0x0001 | -| * SupportedFabrics | 0x0002 | -| * CommissionedFabrics | 0x0003 | -| * TrustedRootCertificates | 0x0004 | -| * CurrentFabricIndex | 0x0005 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command AddNOC + * Attribute MaxGroupKeysPerFabric */ -class OperationalCredentialsAddNOC : public ClusterCommand { +class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ReadAttribute { public: - OperationalCredentialsAddNOC() - : ClusterCommand("add-noc") + ReadGroupKeyManagementMaxGroupKeysPerFabric() + : ReadAttribute("max-group-keys-per-fabric") { - AddArgument("NOCValue", &mNOCValue); - AddArgument("ICACValue", &mICACValue); - AddArgument("IPKValue", &mIPKValue); - AddArgument("CaseAdminNode", 0, UINT64_MAX, &mCaseAdminNode); - AddArgument("AdminVendorId", 0, UINT16_MAX, &mAdminVendorId); - ClusterCommand::AddArguments(); } + ~ReadGroupKeyManagementMaxGroupKeysPerFabric() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterAddNOCParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; - if (mICACValue.HasValue()) { - params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; - } - params.ipkValue = [[NSData alloc] initWithBytes:mIPKValue.data() length:mIPKValue.size()]; - params.caseAdminNode = [NSNumber numberWithUnsignedLongLong:mCaseAdminNode]; - params.adminVendorId = [NSNumber numberWithUnsignedShort:mAdminVendorId]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster addNOCWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::ByteSpan mNOCValue; - chip::Optional mICACValue; - chip::ByteSpan mIPKValue; - chip::NodeId mCaseAdminNode; - uint16_t mAdminVendorId; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement MaxGroupKeysPerFabric read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command AddTrustedRootCertificate - */ -class OperationalCredentialsAddTrustedRootCertificate : public ClusterCommand { +class SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric : public SubscribeAttribute { public: - OperationalCredentialsAddTrustedRootCertificate() - : ClusterCommand("add-trusted-root-certificate") + SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric() + : SubscribeAttribute("max-group-keys-per-fabric") { - AddArgument("RootCertificate", &mRootCertificate); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000B) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterAddTrustedRootCertificateParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.rootCertificate = [[NSData alloc] initWithBytes:mRootCertificate.data() length:mRootCertificate.size()]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster addTrustedRootCertificateWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxGroupKeysPerFabricWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::ByteSpan mRootCertificate; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command AttestationRequest + * Attribute GeneratedCommandList */ -class OperationalCredentialsAttestationRequest : public ClusterCommand { +class ReadGroupKeyManagementGeneratedCommandList : public ReadAttribute { public: - OperationalCredentialsAttestationRequest() - : ClusterCommand("attestation-request") + ReadGroupKeyManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") { - AddArgument("AttestationNonce", &mAttestationNonce); - ClusterCommand::AddArguments(); } + ~ReadGroupKeyManagementGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterAttestationRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.attestationNonce = [[NSData alloc] initWithBytes:mAttestationNonce.data() length:mAttestationNonce.size()]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster attestationRequestWithParams:params - completionHandler:^(CHIPOperationalCredentialsClusterAttestationResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::ByteSpan mAttestationNonce; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command CSRRequest - */ -class OperationalCredentialsCSRRequest : public ClusterCommand { +class SubscribeAttributeGroupKeyManagementGeneratedCommandList : public SubscribeAttribute { public: - OperationalCredentialsCSRRequest() - : ClusterCommand("csrrequest") + SubscribeAttributeGroupKeyManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { - AddArgument("CSRNonce", &mCSRNonce); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeGroupKeyManagementGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000004) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterCSRRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.csrNonce = [[NSData alloc] initWithBytes:mCSRNonce.data() length:mCSRNonce.size()]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster CSRRequestWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterCSRResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::ByteSpan mCSRNonce; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command CertificateChainRequest + * Attribute AcceptedCommandList */ -class OperationalCredentialsCertificateChainRequest : public ClusterCommand { +class ReadGroupKeyManagementAcceptedCommandList : public ReadAttribute { public: - OperationalCredentialsCertificateChainRequest() - : ClusterCommand("certificate-chain-request") + ReadGroupKeyManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") { - AddArgument("CertificateType", 0, UINT8_MAX, &mCertificateType); - ClusterCommand::AddArguments(); } + ~ReadGroupKeyManagementAcceptedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterCertificateChainRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.certificateType = [NSNumber numberWithUnsignedChar:mCertificateType]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster certificateChainRequestWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterCertificateChainResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mCertificateType; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command RemoveFabric - */ -class OperationalCredentialsRemoveFabric : public ClusterCommand { +class SubscribeAttributeGroupKeyManagementAcceptedCommandList : public SubscribeAttribute { public: - OperationalCredentialsRemoveFabric() - : ClusterCommand("remove-fabric") + SubscribeAttributeGroupKeyManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { - AddArgument("FabricIndex", 0, UINT8_MAX, &mFabricIndex); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeGroupKeyManagementAcceptedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000A) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.fabricIndex = [NSNumber numberWithUnsignedChar:mFabricIndex]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster removeFabricWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::FabricIndex mFabricIndex; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command RemoveTrustedRootCertificate + * Attribute AttributeList */ -class OperationalCredentialsRemoveTrustedRootCertificate : public ClusterCommand { +class ReadGroupKeyManagementAttributeList : public ReadAttribute { public: - OperationalCredentialsRemoveTrustedRootCertificate() - : ClusterCommand("remove-trusted-root-certificate") + ReadGroupKeyManagementAttributeList() + : ReadAttribute("attribute-list") { - AddArgument("TrustedRootIdentifier", &mTrustedRootIdentifier); - ClusterCommand::AddArguments(); } + ~ReadGroupKeyManagementAttributeList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveTrustedRootCertificateParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.trustedRootIdentifier = [[NSData alloc] initWithBytes:mTrustedRootIdentifier.data() - length:mTrustedRootIdentifier.size()]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster removeTrustedRootCertificateWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - chip::ByteSpan mTrustedRootIdentifier; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command UpdateFabricLabel - */ -class OperationalCredentialsUpdateFabricLabel : public ClusterCommand { +class SubscribeAttributeGroupKeyManagementAttributeList : public SubscribeAttribute { public: - OperationalCredentialsUpdateFabricLabel() - : ClusterCommand("update-fabric-label") + SubscribeAttributeGroupKeyManagementAttributeList() + : SubscribeAttribute("attribute-list") { - AddArgument("Label", &mLabel); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeGroupKeyManagementAttributeList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000009) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.label = [[NSString alloc] initWithBytes:mLabel.data() length:mLabel.size() encoding:NSUTF8StringEncoding]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster updateFabricLabelWithParams:params - completionHandler:^(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - chip::ByteSpan mLabel; -}; - -/* - * Command UpdateNOC - */ -class OperationalCredentialsUpdateNOC : public ClusterCommand { -public: - OperationalCredentialsUpdateNOC() - : ClusterCommand("update-noc") - { - AddArgument("NOCValue", &mNOCValue); - AddArgument("ICACValue", &mICACValue); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000007) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateNOCParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; - if (mICACValue.HasValue()) { - params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster updateNOCWithParams:params - completionHandler:^( - CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - chip::ByteSpan mNOCValue; - chip::Optional mICACValue; -}; - -/* - * Attribute NOCs - */ -class ReadOperationalCredentialsNOCs : public ReadAttribute { -public: - ReadOperationalCredentialsNOCs() - : ReadAttribute("nocs") - { - } - - ~ReadOperationalCredentialsNOCs() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster readAttributeNOCsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.NOCs response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials NOCs read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class SubscribeAttributeOperationalCredentialsNOCs : public SubscribeAttribute { -public: - SubscribeAttributeOperationalCredentialsNOCs() - : SubscribeAttribute("nocs") - { - } - - ~SubscribeAttributeOperationalCredentialsNOCs() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNOCsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.NOCs response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -42728,72 +45279,69 @@ class SubscribeAttributeOperationalCredentialsNOCs : public SubscribeAttribute { }; /* - * Attribute Fabrics + * Attribute FeatureMap */ -class ReadOperationalCredentialsFabrics : public ReadAttribute { +class ReadGroupKeyManagementFeatureMap : public ReadAttribute { public: - ReadOperationalCredentialsFabrics() - : ReadAttribute("fabrics") + ReadGroupKeyManagementFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadOperationalCredentialsFabrics() {} + ~ReadGroupKeyManagementFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster readAttributeFabricsWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials Fabrics read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "GroupKeyManagement FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeOperationalCredentialsFabrics : public SubscribeAttribute { +class SubscribeAttributeGroupKeyManagementFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsFabrics() - : SubscribeAttribute("fabrics") + SubscribeAttributeGroupKeyManagementFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeOperationalCredentialsFabrics() {} + ~SubscribeAttributeGroupKeyManagementFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -42805,32 +45353,32 @@ class SubscribeAttributeOperationalCredentialsFabrics : public SubscribeAttribut }; /* - * Attribute SupportedFabrics + * Attribute ClusterRevision */ -class ReadOperationalCredentialsSupportedFabrics : public ReadAttribute { +class ReadGroupKeyManagementClusterRevision : public ReadAttribute { public: - ReadOperationalCredentialsSupportedFabrics() - : ReadAttribute("supported-fabrics") + ReadGroupKeyManagementClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadOperationalCredentialsSupportedFabrics() {} + ~ReadGroupKeyManagementClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.SupportedFabrics response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials SupportedFabrics read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "GroupKeyManagement ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -42838,37 +45386,37 @@ class ReadOperationalCredentialsSupportedFabrics : public ReadAttribute { } }; -class SubscribeAttributeOperationalCredentialsSupportedFabrics : public SubscribeAttribute { +class SubscribeAttributeGroupKeyManagementClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsSupportedFabrics() - : SubscribeAttribute("supported-fabrics") + SubscribeAttributeGroupKeyManagementClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeOperationalCredentialsSupportedFabrics() {} + ~SubscribeAttributeGroupKeyManagementClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSupportedFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.SupportedFabrics response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -42879,183 +45427,362 @@ class SubscribeAttributeOperationalCredentialsSupportedFabrics : public Subscrib } }; +/*----------------------------------------------------------------------------*\ +| Cluster Groups | 0x0004 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AddGroup | 0x00 | +| * ViewGroup | 0x01 | +| * GetGroupMembership | 0x02 | +| * RemoveGroup | 0x03 | +| * RemoveAllGroups | 0x04 | +| * AddGroupIfIdentifying | 0x05 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * NameSupport | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute CommissionedFabrics + * Command AddGroup */ -class ReadOperationalCredentialsCommissionedFabrics : public ReadAttribute { +class GroupsAddGroup : public ClusterCommand { public: - ReadOperationalCredentialsCommissionedFabrics() - : ReadAttribute("commissioned-fabrics") + GroupsAddGroup() + : ClusterCommand("add-group") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("GroupName", &mGroupName); + ClusterCommand::AddArguments(); } - ~ReadOperationalCredentialsCommissionedFabrics() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.CommissionedFabrics response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials CommissionedFabrics read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.groupName = [[NSString alloc] initWithBytes:mGroupName.data() + length:mGroupName.size() + encoding:NSUTF8StringEncoding]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::Groups::Commands::AddGroup::Type mRequest; + chip::GroupId mGroupId; + chip::ByteSpan mGroupName; }; -class SubscribeAttributeOperationalCredentialsCommissionedFabrics : public SubscribeAttribute { +/* + * Command ViewGroup + */ +class GroupsViewGroup : public ClusterCommand { public: - SubscribeAttributeOperationalCredentialsCommissionedFabrics() - : SubscribeAttribute("commissioned-fabrics") + GroupsViewGroup() + : ClusterCommand("view-group") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeOperationalCredentialsCommissionedFabrics() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000003) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCommissionedFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.CommissionedFabrics response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000001) on endpoint %u", endpointId); - return CHIP_NO_ERROR; + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster viewGroupWithParams:params + completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::Groups::Commands::ViewGroup::Type mRequest; + chip::GroupId mGroupId; }; /* - * Attribute TrustedRootCertificates + * Command GetGroupMembership */ -class ReadOperationalCredentialsTrustedRootCertificates : public ReadAttribute { +class GroupsGetGroupMembership : public ClusterCommand { public: - ReadOperationalCredentialsTrustedRootCertificates() - : ReadAttribute("trusted-root-certificates") + GroupsGetGroupMembership() + : ClusterCommand("get-group-membership") + , mComplex_GroupList(&mRequest.groupList) { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupList", &mComplex_GroupList); + ClusterCommand::AddArguments(); } - ~ReadOperationalCredentialsTrustedRootCertificates() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTrustedRootCertificatesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials TrustedRootCertificates read Error: %s", chip::ErrorStr(err)); + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.groupList) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; } - SetCommandExitStatus(err); - }]; - return err; + params.groupList = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getGroupMembershipWithParams:params + completionHandler:^(CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type mRequest; + TypedComplexArgument> mComplex_GroupList; }; -class SubscribeAttributeOperationalCredentialsTrustedRootCertificates : public SubscribeAttribute { +/* + * Command RemoveGroup + */ +class GroupsRemoveGroup : public ClusterCommand { public: - SubscribeAttributeOperationalCredentialsTrustedRootCertificates() - : SubscribeAttribute("trusted-root-certificates") + GroupsRemoveGroup() + : ClusterCommand("remove-group") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeOperationalCredentialsTrustedRootCertificates() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + removeGroupWithParams:params + completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Groups::Commands::RemoveGroup::Type mRequest; + chip::GroupId mGroupId; +}; + +/* + * Command RemoveAllGroups + */ +class GroupsRemoveAllGroups : public ClusterCommand { +public: + GroupsRemoveAllGroups() + : ClusterCommand("remove-all-groups") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTrustedRootCertificatesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupsClusterRemoveAllGroupsParams 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 removeAllGroupsWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type mRequest; +}; + +/* + * Command AddGroupIfIdentifying + */ +class GroupsAddGroupIfIdentifying : public ClusterCommand { +public: + GroupsAddGroupIfIdentifying() + : ClusterCommand("add-group-if-identifying") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("GroupName", &mGroupName); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPGroupsClusterAddGroupIfIdentifyingParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.groupName = [[NSString alloc] initWithBytes:mGroupName.data() + length:mGroupName.size() + encoding:NSUTF8StringEncoding]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addGroupIfIdentifyingWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type mRequest; + chip::GroupId mGroupId; + chip::ByteSpan mGroupName; }; /* - * Attribute CurrentFabricIndex + * Attribute NameSupport */ -class ReadOperationalCredentialsCurrentFabricIndex : public ReadAttribute { +class ReadGroupsNameSupport : public ReadAttribute { public: - ReadOperationalCredentialsCurrentFabricIndex() - : ReadAttribute("current-fabric-index") + ReadGroupsNameSupport() + : ReadAttribute("name-support") { } - ~ReadOperationalCredentialsCurrentFabricIndex() {} + ~ReadGroupsNameSupport() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", [value description]); + [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.NameSupport response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials CurrentFabricIndex read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Groups NameSupport read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43063,37 +45790,34 @@ class ReadOperationalCredentialsCurrentFabricIndex : public ReadAttribute { } }; -class SubscribeAttributeOperationalCredentialsCurrentFabricIndex : public SubscribeAttribute { +class SubscribeAttributeGroupsNameSupport : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsCurrentFabricIndex() - : SubscribeAttribute("current-fabric-index") + SubscribeAttributeGroupsNameSupport() + : SubscribeAttribute("name-support") { } - ~SubscribeAttributeOperationalCredentialsCurrentFabricIndex() {} + ~SubscribeAttributeGroupsNameSupport() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentFabricIndexWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNameSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.NameSupport response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43107,30 +45831,28 @@ class SubscribeAttributeOperationalCredentialsCurrentFabricIndex : public Subscr /* * Attribute GeneratedCommandList */ -class ReadOperationalCredentialsGeneratedCommandList : public ReadAttribute { +class ReadGroupsGeneratedCommandList : public ReadAttribute { public: - ReadOperationalCredentialsGeneratedCommandList() + ReadGroupsGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadOperationalCredentialsGeneratedCommandList() {} + ~ReadGroupsGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.GeneratedCommandList response %@", [value description]); + NSLog(@"Groups.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Groups GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43138,22 +45860,20 @@ class ReadOperationalCredentialsGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeOperationalCredentialsGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeGroupsGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsGeneratedCommandList() + SubscribeAttributeGroupsGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeOperationalCredentialsGeneratedCommandList() {} + ~SubscribeAttributeGroupsGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -43163,8 +45883,7 @@ class SubscribeAttributeOperationalCredentialsGeneratedCommandList : public Subs params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.GeneratedCommandList response %@", - [value description]); + NSLog(@"Groups.GeneratedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -43182,30 +45901,28 @@ class SubscribeAttributeOperationalCredentialsGeneratedCommandList : public Subs /* * Attribute AcceptedCommandList */ -class ReadOperationalCredentialsAcceptedCommandList : public ReadAttribute { +class ReadGroupsAcceptedCommandList : public ReadAttribute { public: - ReadOperationalCredentialsAcceptedCommandList() + ReadGroupsAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadOperationalCredentialsAcceptedCommandList() {} + ~ReadGroupsAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.AcceptedCommandList response %@", [value description]); + NSLog(@"Groups.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Groups AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43213,22 +45930,20 @@ class ReadOperationalCredentialsAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeOperationalCredentialsAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeGroupsAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsAcceptedCommandList() + SubscribeAttributeGroupsAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeOperationalCredentialsAcceptedCommandList() {} + ~SubscribeAttributeGroupsAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -43238,8 +45953,7 @@ class SubscribeAttributeOperationalCredentialsAcceptedCommandList : public Subsc params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.AcceptedCommandList response %@", - [value description]); + NSLog(@"Groups.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -43257,30 +45971,28 @@ class SubscribeAttributeOperationalCredentialsAcceptedCommandList : public Subsc /* * Attribute AttributeList */ -class ReadOperationalCredentialsAttributeList : public ReadAttribute { +class ReadGroupsAttributeList : public ReadAttribute { public: - ReadOperationalCredentialsAttributeList() + ReadGroupsAttributeList() : ReadAttribute("attribute-list") { } - ~ReadOperationalCredentialsAttributeList() {} + ~ReadGroupsAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); + NSLog(@"Groups.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Groups AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43288,37 +46000,34 @@ class ReadOperationalCredentialsAttributeList : public ReadAttribute { } }; -class SubscribeAttributeOperationalCredentialsAttributeList : public SubscribeAttribute { +class SubscribeAttributeGroupsAttributeList : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsAttributeList() + SubscribeAttributeGroupsAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeOperationalCredentialsAttributeList() {} + ~SubscribeAttributeGroupsAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43330,32 +46039,30 @@ class SubscribeAttributeOperationalCredentialsAttributeList : public SubscribeAt }; /* - * Attribute ClusterRevision + * Attribute FeatureMap */ -class ReadOperationalCredentialsClusterRevision : public ReadAttribute { +class ReadGroupsFeatureMap : public ReadAttribute { public: - ReadOperationalCredentialsClusterRevision() - : ReadAttribute("cluster-revision") + ReadGroupsFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadOperationalCredentialsClusterRevision() {} + ~ReadGroupsFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.ClusterRevision response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "OperationalCredentials ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Groups FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43363,37 +46070,34 @@ class ReadOperationalCredentialsClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeOperationalCredentialsClusterRevision : public SubscribeAttribute { +class SubscribeAttributeGroupsFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeOperationalCredentialsClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeGroupsFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeOperationalCredentialsClusterRevision() {} + ~SubscribeAttributeGroupsFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43404,77 +46108,31 @@ class SubscribeAttributeOperationalCredentialsClusterRevision : public Subscribe } }; -/*----------------------------------------------------------------------------*\ -| Cluster PowerSource | 0x002F | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Status | 0x0000 | -| * Order | 0x0001 | -| * Description | 0x0002 | -| * WiredAssessedInputVoltage | 0x0003 | -| * WiredAssessedInputFrequency | 0x0004 | -| * WiredCurrentType | 0x0005 | -| * WiredAssessedCurrent | 0x0006 | -| * WiredNominalVoltage | 0x0007 | -| * WiredMaximumCurrent | 0x0008 | -| * WiredPresent | 0x0009 | -| * ActiveWiredFaults | 0x000A | -| * BatteryVoltage | 0x000B | -| * BatteryPercentRemaining | 0x000C | -| * BatteryTimeRemaining | 0x000D | -| * BatteryChargeLevel | 0x000E | -| * BatteryReplacementNeeded | 0x000F | -| * BatteryReplaceability | 0x0010 | -| * BatteryPresent | 0x0011 | -| * ActiveBatteryFaults | 0x0012 | -| * BatteryReplacementDescription | 0x0013 | -| * BatteryCommonDesignation | 0x0014 | -| * BatteryANSIDesignation | 0x0015 | -| * BatteryIECDesignation | 0x0016 | -| * BatteryApprovedChemistry | 0x0017 | -| * BatteryCapacity | 0x0018 | -| * BatteryQuantity | 0x0019 | -| * BatteryChargeState | 0x001A | -| * BatteryTimeToFullCharge | 0x001B | -| * BatteryFunctionalWhileCharging | 0x001C | -| * BatteryChargingCurrent | 0x001D | -| * ActiveBatteryChargeFaults | 0x001E | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute Status + * Attribute ClusterRevision */ -class ReadPowerSourceStatus : public ReadAttribute { +class ReadGroupsClusterRevision : public ReadAttribute { public: - ReadPowerSourceStatus() - : ReadAttribute("status") + ReadGroupsClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPowerSourceStatus() {} + ~ReadGroupsClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.Status response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource Status read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Groups ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43482,34 +46140,34 @@ class ReadPowerSourceStatus : public ReadAttribute { } }; -class SubscribeAttributePowerSourceStatus : public SubscribeAttribute { +class SubscribeAttributeGroupsClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePowerSourceStatus() - : SubscribeAttribute("status") + SubscribeAttributeGroupsClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePowerSourceStatus() {} + ~SubscribeAttributeGroupsClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.Status response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Groups.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43520,101 +46178,196 @@ class SubscribeAttributePowerSourceStatus : public SubscribeAttribute { } }; +/*----------------------------------------------------------------------------*\ +| Cluster Identify | 0x0003 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Identify | 0x00 | +| * IdentifyQuery | 0x01 | +| * TriggerEffect | 0x40 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * IdentifyTime | 0x0000 | +| * IdentifyType | 0x0001 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute Order + * Command Identify */ -class ReadPowerSourceOrder : public ReadAttribute { +class IdentifyIdentify : public ClusterCommand { public: - ReadPowerSourceOrder() - : ReadAttribute("order") + IdentifyIdentify() + : ClusterCommand("identify") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("IdentifyTime", 0, UINT16_MAX, &mIdentifyTime); + ClusterCommand::AddArguments(); } - ~ReadPowerSourceOrder() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.Order response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PowerSource Order read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class SubscribeAttributePowerSourceOrder : public SubscribeAttribute { -public: - SubscribeAttributePowerSourceOrder() - : SubscribeAttribute("order") - { - } - - ~SubscribeAttributePowerSourceOrder() {} + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.identifyTime = [NSNumber numberWithUnsignedShort:mIdentifyTime]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster identifyWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Identify::Commands::Identify::Type mRequest; + uint16_t mIdentifyTime; +}; + +/* + * Command IdentifyQuery + */ +class IdentifyIdentifyQuery : public ClusterCommand { +public: + IdentifyIdentifyQuery() + : ClusterCommand("identify-query") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOrderWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.Order response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPIdentifyClusterIdentifyQueryParams 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 identifyQueryWithCompletionHandler:^( + CHIPIdentifyClusterIdentifyQueryResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::Identify::Commands::IdentifyQuery::Type mRequest; +}; + +/* + * Command TriggerEffect + */ +class IdentifyTriggerEffect : public ClusterCommand { +public: + IdentifyTriggerEffect() + : ClusterCommand("trigger-effect") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("EffectIdentifier", 0, UINT8_MAX, &mEffectIdentifier); + AddArgument("EffectVariant", 0, UINT8_MAX, &mEffectVariant); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000040) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:mEffectIdentifier]; + params.effectVariant = [NSNumber numberWithUnsignedChar:mEffectVariant]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster triggerEffectWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::Identify::Commands::TriggerEffect::Type mRequest; + uint8_t mEffectIdentifier; + uint8_t mEffectVariant; }; /* - * Attribute Description + * Attribute IdentifyTime */ -class ReadPowerSourceDescription : public ReadAttribute { +class ReadIdentifyIdentifyTime : public ReadAttribute { public: - ReadPowerSourceDescription() - : ReadAttribute("description") + ReadIdentifyIdentifyTime() + : ReadAttribute("identify-time") { } - ~ReadPowerSourceDescription() {} + ~ReadIdentifyIdentifyTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.Description response %@", [value description]); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.IdentifyTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource Description read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Identify IdentifyTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43622,34 +46375,74 @@ class ReadPowerSourceDescription : public ReadAttribute { } }; -class SubscribeAttributePowerSourceDescription : public SubscribeAttribute { +class WriteIdentifyIdentifyTime : public WriteAttribute { public: - SubscribeAttributePowerSourceDescription() - : SubscribeAttribute("description") + WriteIdentifyIdentifyTime() + : WriteAttribute("identify-time") { + AddArgument("attr-name", "identify-time"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePowerSourceDescription() {} + ~WriteIdentifyIdentifyTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) WriteAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributeIdentifyTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Identify IdentifyTime write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeIdentifyIdentifyTime : public SubscribeAttribute { +public: + SubscribeAttributeIdentifyIdentifyTime() + : SubscribeAttribute("identify-time") + { + } + + ~SubscribeAttributeIdentifyIdentifyTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.Description response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeIdentifyTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.IdentifyTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43661,68 +46454,65 @@ class SubscribeAttributePowerSourceDescription : public SubscribeAttribute { }; /* - * Attribute WiredAssessedInputVoltage + * Attribute IdentifyType */ -class ReadPowerSourceWiredAssessedInputVoltage : public ReadAttribute { +class ReadIdentifyIdentifyType : public ReadAttribute { public: - ReadPowerSourceWiredAssessedInputVoltage() - : ReadAttribute("wired-assessed-input-voltage") + ReadIdentifyIdentifyType() + : ReadAttribute("identify-type") { } - ~ReadPowerSourceWiredAssessedInputVoltage() {} + ~ReadIdentifyIdentifyType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeWiredAssessedInputVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.IdentifyType response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredAssessedInputVoltage read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Identify IdentifyType read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceWiredAssessedInputVoltage : public SubscribeAttribute { +class SubscribeAttributeIdentifyIdentifyType : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredAssessedInputVoltage() - : SubscribeAttribute("wired-assessed-input-voltage") + SubscribeAttributeIdentifyIdentifyType() + : SubscribeAttribute("identify-type") { } - ~SubscribeAttributePowerSourceWiredAssessedInputVoltage() {} + ~SubscribeAttributeIdentifyIdentifyType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeWiredAssessedInputVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeIdentifyTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.IdentifyType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43734,68 +46524,66 @@ class SubscribeAttributePowerSourceWiredAssessedInputVoltage : public SubscribeA }; /* - * Attribute WiredAssessedInputFrequency + * Attribute GeneratedCommandList */ -class ReadPowerSourceWiredAssessedInputFrequency : public ReadAttribute { +class ReadIdentifyGeneratedCommandList : public ReadAttribute { public: - ReadPowerSourceWiredAssessedInputFrequency() - : ReadAttribute("wired-assessed-input-frequency") + ReadIdentifyGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadPowerSourceWiredAssessedInputFrequency() {} + ~ReadIdentifyGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeWiredAssessedInputFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredAssessedInputFrequency read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Identify GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceWiredAssessedInputFrequency : public SubscribeAttribute { +class SubscribeAttributeIdentifyGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredAssessedInputFrequency() - : SubscribeAttribute("wired-assessed-input-frequency") + SubscribeAttributeIdentifyGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePowerSourceWiredAssessedInputFrequency() {} + ~SubscribeAttributeIdentifyGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeWiredAssessedInputFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43807,30 +46595,30 @@ class SubscribeAttributePowerSourceWiredAssessedInputFrequency : public Subscrib }; /* - * Attribute WiredCurrentType + * Attribute AcceptedCommandList */ -class ReadPowerSourceWiredCurrentType : public ReadAttribute { +class ReadIdentifyAcceptedCommandList : public ReadAttribute { public: - ReadPowerSourceWiredCurrentType() - : ReadAttribute("wired-current-type") + ReadIdentifyAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPowerSourceWiredCurrentType() {} + ~ReadIdentifyAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWiredCurrentTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredCurrentType read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Identify AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43838,34 +46626,34 @@ class ReadPowerSourceWiredCurrentType : public ReadAttribute { } }; -class SubscribeAttributePowerSourceWiredCurrentType : public SubscribeAttribute { +class SubscribeAttributeIdentifyAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredCurrentType() - : SubscribeAttribute("wired-current-type") + SubscribeAttributeIdentifyAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePowerSourceWiredCurrentType() {} + ~SubscribeAttributeIdentifyAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeWiredCurrentTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43877,30 +46665,30 @@ class SubscribeAttributePowerSourceWiredCurrentType : public SubscribeAttribute }; /* - * Attribute WiredAssessedCurrent + * Attribute AttributeList */ -class ReadPowerSourceWiredAssessedCurrent : public ReadAttribute { +class ReadIdentifyAttributeList : public ReadAttribute { public: - ReadPowerSourceWiredAssessedCurrent() - : ReadAttribute("wired-assessed-current") + ReadIdentifyAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPowerSourceWiredAssessedCurrent() {} + ~ReadIdentifyAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWiredAssessedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredAssessedCurrent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Identify AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43908,35 +46696,34 @@ class ReadPowerSourceWiredAssessedCurrent : public ReadAttribute { } }; -class SubscribeAttributePowerSourceWiredAssessedCurrent : public SubscribeAttribute { +class SubscribeAttributeIdentifyAttributeList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredAssessedCurrent() - : SubscribeAttribute("wired-assessed-current") + SubscribeAttributeIdentifyAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePowerSourceWiredAssessedCurrent() {} + ~SubscribeAttributeIdentifyAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeWiredAssessedCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -43948,30 +46735,30 @@ class SubscribeAttributePowerSourceWiredAssessedCurrent : public SubscribeAttrib }; /* - * Attribute WiredNominalVoltage + * Attribute FeatureMap */ -class ReadPowerSourceWiredNominalVoltage : public ReadAttribute { +class ReadIdentifyFeatureMap : public ReadAttribute { public: - ReadPowerSourceWiredNominalVoltage() - : ReadAttribute("wired-nominal-voltage") + ReadIdentifyFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPowerSourceWiredNominalVoltage() {} + ~ReadIdentifyFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWiredNominalVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredNominalVoltage read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Identify FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -43979,35 +46766,34 @@ class ReadPowerSourceWiredNominalVoltage : public ReadAttribute { } }; -class SubscribeAttributePowerSourceWiredNominalVoltage : public SubscribeAttribute { +class SubscribeAttributeIdentifyFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredNominalVoltage() - : SubscribeAttribute("wired-nominal-voltage") + SubscribeAttributeIdentifyFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePowerSourceWiredNominalVoltage() {} + ~SubscribeAttributeIdentifyFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeWiredNominalVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44019,30 +46805,30 @@ class SubscribeAttributePowerSourceWiredNominalVoltage : public SubscribeAttribu }; /* - * Attribute WiredMaximumCurrent + * Attribute ClusterRevision */ -class ReadPowerSourceWiredMaximumCurrent : public ReadAttribute { +class ReadIdentifyClusterRevision : public ReadAttribute { public: - ReadPowerSourceWiredMaximumCurrent() - : ReadAttribute("wired-maximum-current") + ReadIdentifyClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPowerSourceWiredMaximumCurrent() {} + ~ReadIdentifyClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWiredMaximumCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredMaximumCurrent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Identify ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44050,35 +46836,34 @@ class ReadPowerSourceWiredMaximumCurrent : public ReadAttribute { } }; -class SubscribeAttributePowerSourceWiredMaximumCurrent : public SubscribeAttribute { +class SubscribeAttributeIdentifyClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredMaximumCurrent() - : SubscribeAttribute("wired-maximum-current") + SubscribeAttributeIdentifyClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePowerSourceWiredMaximumCurrent() {} + ~SubscribeAttributeIdentifyClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeWiredMaximumCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Identify.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44089,31 +46874,53 @@ class SubscribeAttributePowerSourceWiredMaximumCurrent : public SubscribeAttribu } }; +/*----------------------------------------------------------------------------*\ +| Cluster IlluminanceMeasurement | 0x0400 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | +| * LightSensorType | 0x0004 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute WiredPresent + * Attribute MeasuredValue */ -class ReadPowerSourceWiredPresent : public ReadAttribute { +class ReadIlluminanceMeasurementMeasuredValue : public ReadAttribute { public: - ReadPowerSourceWiredPresent() - : ReadAttribute("wired-present") + ReadIlluminanceMeasurementMeasuredValue() + : ReadAttribute("measured-value") { } - ~ReadPowerSourceWiredPresent() {} + ~ReadIlluminanceMeasurementMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeWiredPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredPresent response %@", [value description]); + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource WiredPresent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44121,34 +46928,37 @@ class ReadPowerSourceWiredPresent : public ReadAttribute { } }; -class SubscribeAttributePowerSourceWiredPresent : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementMeasuredValue : public SubscribeAttribute { public: - SubscribeAttributePowerSourceWiredPresent() - : SubscribeAttribute("wired-present") + SubscribeAttributeIlluminanceMeasurementMeasuredValue() + : SubscribeAttribute("measured-value") { } - ~SubscribeAttributePowerSourceWiredPresent() {} + ~SubscribeAttributeIlluminanceMeasurementMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeWiredPresentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.WiredPresent response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44160,30 +46970,32 @@ class SubscribeAttributePowerSourceWiredPresent : public SubscribeAttribute { }; /* - * Attribute ActiveWiredFaults + * Attribute MinMeasuredValue */ -class ReadPowerSourceActiveWiredFaults : public ReadAttribute { +class ReadIlluminanceMeasurementMinMeasuredValue : public ReadAttribute { public: - ReadPowerSourceActiveWiredFaults() - : ReadAttribute("active-wired-faults") + ReadIlluminanceMeasurementMinMeasuredValue() + : ReadAttribute("min-measured-value") { } - ~ReadPowerSourceActiveWiredFaults() {} + ~ReadIlluminanceMeasurementMinMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveWiredFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource ActiveWiredFaults read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44191,34 +47003,37 @@ class ReadPowerSourceActiveWiredFaults : public ReadAttribute { } }; -class SubscribeAttributePowerSourceActiveWiredFaults : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementMinMeasuredValue : public SubscribeAttribute { public: - SubscribeAttributePowerSourceActiveWiredFaults() - : SubscribeAttribute("active-wired-faults") + SubscribeAttributeIlluminanceMeasurementMinMeasuredValue() + : SubscribeAttribute("min-measured-value") { } - ~SubscribeAttributePowerSourceActiveWiredFaults() {} + ~SubscribeAttributeIlluminanceMeasurementMinMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeActiveWiredFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44230,30 +47045,32 @@ class SubscribeAttributePowerSourceActiveWiredFaults : public SubscribeAttribute }; /* - * Attribute BatteryVoltage + * Attribute MaxMeasuredValue */ -class ReadPowerSourceBatteryVoltage : public ReadAttribute { +class ReadIlluminanceMeasurementMaxMeasuredValue : public ReadAttribute { public: - ReadPowerSourceBatteryVoltage() - : ReadAttribute("battery-voltage") + ReadIlluminanceMeasurementMaxMeasuredValue() + : ReadAttribute("max-measured-value") { } - ~ReadPowerSourceBatteryVoltage() {} + ~ReadIlluminanceMeasurementMaxMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryVoltage response %@", [value description]); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryVoltage read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44261,34 +47078,37 @@ class ReadPowerSourceBatteryVoltage : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryVoltage : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryVoltage() - : SubscribeAttribute("battery-voltage") + SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue() + : SubscribeAttribute("max-measured-value") { } - ~SubscribeAttributePowerSourceBatteryVoltage() {} + ~SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryVoltage response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44300,67 +47120,69 @@ class SubscribeAttributePowerSourceBatteryVoltage : public SubscribeAttribute { }; /* - * Attribute BatteryPercentRemaining + * Attribute Tolerance */ -class ReadPowerSourceBatteryPercentRemaining : public ReadAttribute { +class ReadIlluminanceMeasurementTolerance : public ReadAttribute { public: - ReadPowerSourceBatteryPercentRemaining() - : ReadAttribute("battery-percent-remaining") + ReadIlluminanceMeasurementTolerance() + : ReadAttribute("tolerance") { } - ~ReadPowerSourceBatteryPercentRemaining() {} + ~ReadIlluminanceMeasurementTolerance() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryPercentRemaining response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryPercentRemaining read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "IlluminanceMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceBatteryPercentRemaining : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementTolerance : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryPercentRemaining() - : SubscribeAttribute("battery-percent-remaining") + SubscribeAttributeIlluminanceMeasurementTolerance() + : SubscribeAttribute("tolerance") { } - ~SubscribeAttributePowerSourceBatteryPercentRemaining() {} + ~SubscribeAttributeIlluminanceMeasurementTolerance() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryPercentRemainingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryPercentRemaining response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44372,30 +47194,32 @@ class SubscribeAttributePowerSourceBatteryPercentRemaining : public SubscribeAtt }; /* - * Attribute BatteryTimeRemaining + * Attribute LightSensorType */ -class ReadPowerSourceBatteryTimeRemaining : public ReadAttribute { +class ReadIlluminanceMeasurementLightSensorType : public ReadAttribute { public: - ReadPowerSourceBatteryTimeRemaining() - : ReadAttribute("battery-time-remaining") + ReadIlluminanceMeasurementLightSensorType() + : ReadAttribute("light-sensor-type") { } - ~ReadPowerSourceBatteryTimeRemaining() {} + ~ReadIlluminanceMeasurementLightSensorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryTimeRemaining response %@", [value description]); + [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.LightSensorType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryTimeRemaining read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement LightSensorType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44403,31 +47227,33 @@ class ReadPowerSourceBatteryTimeRemaining : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryTimeRemaining : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementLightSensorType : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryTimeRemaining() - : SubscribeAttribute("battery-time-remaining") + SubscribeAttributeIlluminanceMeasurementLightSensorType() + : SubscribeAttribute("light-sensor-type") { } - ~SubscribeAttributePowerSourceBatteryTimeRemaining() {} + ~SubscribeAttributeIlluminanceMeasurementLightSensorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryTimeRemainingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeLightSensorTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryTimeRemaining response %@", [value description]); + NSLog(@"IlluminanceMeasurement.LightSensorType response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -44443,30 +47269,32 @@ class SubscribeAttributePowerSourceBatteryTimeRemaining : public SubscribeAttrib }; /* - * Attribute BatteryChargeLevel + * Attribute GeneratedCommandList */ -class ReadPowerSourceBatteryChargeLevel : public ReadAttribute { +class ReadIlluminanceMeasurementGeneratedCommandList : public ReadAttribute { public: - ReadPowerSourceBatteryChargeLevel() - : ReadAttribute("battery-charge-level") + ReadIlluminanceMeasurementGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadPowerSourceBatteryChargeLevel() {} + ~ReadIlluminanceMeasurementGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargeLevel response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryChargeLevel read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44474,35 +47302,37 @@ class ReadPowerSourceBatteryChargeLevel : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryChargeLevel : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryChargeLevel() - : SubscribeAttribute("battery-charge-level") + SubscribeAttributeIlluminanceMeasurementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePowerSourceBatteryChargeLevel() {} + ~SubscribeAttributeIlluminanceMeasurementGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryChargeLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargeLevel response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44514,63 +47344,65 @@ class SubscribeAttributePowerSourceBatteryChargeLevel : public SubscribeAttribut }; /* - * Attribute BatteryReplacementNeeded + * Attribute AcceptedCommandList */ -class ReadPowerSourceBatteryReplacementNeeded : public ReadAttribute { +class ReadIlluminanceMeasurementAcceptedCommandList : public ReadAttribute { public: - ReadPowerSourceBatteryReplacementNeeded() - : ReadAttribute("battery-replacement-needed") + ReadIlluminanceMeasurementAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPowerSourceBatteryReplacementNeeded() {} + ~ReadIlluminanceMeasurementAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeBatteryReplacementNeededWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryReplacementNeeded response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryReplacementNeeded read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "IlluminanceMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceBatteryReplacementNeeded : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryReplacementNeeded() - : SubscribeAttribute("battery-replacement-needed") + SubscribeAttributeIlluminanceMeasurementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePowerSourceBatteryReplacementNeeded() {} + ~SubscribeAttributeIlluminanceMeasurementAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryReplacementNeededWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryReplacementNeeded response %@", + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -44587,30 +47419,32 @@ class SubscribeAttributePowerSourceBatteryReplacementNeeded : public SubscribeAt }; /* - * Attribute BatteryReplaceability + * Attribute AttributeList */ -class ReadPowerSourceBatteryReplaceability : public ReadAttribute { +class ReadIlluminanceMeasurementAttributeList : public ReadAttribute { public: - ReadPowerSourceBatteryReplaceability() - : ReadAttribute("battery-replaceability") + ReadIlluminanceMeasurementAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPowerSourceBatteryReplaceability() {} + ~ReadIlluminanceMeasurementAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryReplaceabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryReplaceability response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryReplaceability read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44618,35 +47452,37 @@ class ReadPowerSourceBatteryReplaceability : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryReplaceability : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementAttributeList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryReplaceability() - : SubscribeAttribute("battery-replaceability") + SubscribeAttributeIlluminanceMeasurementAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePowerSourceBatteryReplaceability() {} + ~SubscribeAttributeIlluminanceMeasurementAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryReplaceabilityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryReplaceability response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44658,30 +47494,32 @@ class SubscribeAttributePowerSourceBatteryReplaceability : public SubscribeAttri }; /* - * Attribute BatteryPresent + * Attribute FeatureMap */ -class ReadPowerSourceBatteryPresent : public ReadAttribute { +class ReadIlluminanceMeasurementFeatureMap : public ReadAttribute { public: - ReadPowerSourceBatteryPresent() - : ReadAttribute("battery-present") + ReadIlluminanceMeasurementFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPowerSourceBatteryPresent() {} + ~ReadIlluminanceMeasurementFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryPresent response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryPresent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44689,34 +47527,36 @@ class ReadPowerSourceBatteryPresent : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryPresent : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryPresent() - : SubscribeAttribute("battery-present") + SubscribeAttributeIlluminanceMeasurementFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePowerSourceBatteryPresent() {} + ~SubscribeAttributeIlluminanceMeasurementFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryPresentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryPresent response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44728,30 +47568,32 @@ class SubscribeAttributePowerSourceBatteryPresent : public SubscribeAttribute { }; /* - * Attribute ActiveBatteryFaults + * Attribute ClusterRevision */ -class ReadPowerSourceActiveBatteryFaults : public ReadAttribute { +class ReadIlluminanceMeasurementClusterRevision : public ReadAttribute { public: - ReadPowerSourceActiveBatteryFaults() - : ReadAttribute("active-battery-faults") + ReadIlluminanceMeasurementClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPowerSourceActiveBatteryFaults() {} + ~ReadIlluminanceMeasurementClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource ActiveBatteryFaults read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "IlluminanceMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44759,35 +47601,37 @@ class ReadPowerSourceActiveBatteryFaults : public ReadAttribute { } }; -class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribute { +class SubscribeAttributeIlluminanceMeasurementClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePowerSourceActiveBatteryFaults() - : SubscribeAttribute("active-battery-faults") + SubscribeAttributeIlluminanceMeasurementClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePowerSourceActiveBatteryFaults() {} + ~SubscribeAttributeIlluminanceMeasurementClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeActiveBatteryFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44798,143 +47642,133 @@ class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribu } }; +/*----------------------------------------------------------------------------*\ +| Cluster KeypadInput | 0x0509 | +|------------------------------------------------------------------------------| +| Commands: | | +| * SendKey | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute BatteryReplacementDescription + * Command SendKey */ -class ReadPowerSourceBatteryReplacementDescription : public ReadAttribute { +class KeypadInputSendKey : public ClusterCommand { public: - ReadPowerSourceBatteryReplacementDescription() - : ReadAttribute("battery-replacement-description") + KeypadInputSendKey() + : ClusterCommand("send-key") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("KeyCode", 0, UINT8_MAX, &mKeyCode); + ClusterCommand::AddArguments(); } - ~ReadPowerSourceBatteryReplacementDescription() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000013) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryReplacementDescriptionWithCompletionHandler:^( - NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryReplacementDescription response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryReplacementDescription read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class SubscribeAttributePowerSourceBatteryReplacementDescription : public SubscribeAttribute { -public: - SubscribeAttributePowerSourceBatteryReplacementDescription() - : SubscribeAttribute("battery-replacement-description") - { - } - - ~SubscribeAttributePowerSourceBatteryReplacementDescription() {} + ChipLogProgress(chipTool, "Sending cluster (0x00000509) command (0x00000000) on endpoint %u", endpointId); - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryReplacementDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryReplacementDescription response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.keyCode = [NSNumber numberWithUnsignedChar:mKeyCode]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + sendKeyWithParams:params + completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::KeypadInput::Commands::SendKey::Type mRequest; + uint8_t mKeyCode; }; /* - * Attribute BatteryCommonDesignation + * Attribute GeneratedCommandList */ -class ReadPowerSourceBatteryCommonDesignation : public ReadAttribute { +class ReadKeypadInputGeneratedCommandList : public ReadAttribute { public: - ReadPowerSourceBatteryCommonDesignation() - : ReadAttribute("battery-common-designation") + ReadKeypadInputGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadPowerSourceBatteryCommonDesignation() {} + ~ReadKeypadInputGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeBatteryCommonDesignationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryCommonDesignation response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryCommonDesignation read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "KeypadInput GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceBatteryCommonDesignation : public SubscribeAttribute { +class SubscribeAttributeKeypadInputGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryCommonDesignation() - : SubscribeAttribute("battery-common-designation") + SubscribeAttributeKeypadInputGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePowerSourceBatteryCommonDesignation() {} + ~SubscribeAttributeKeypadInputGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeBatteryCommonDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryCommonDesignation response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44946,30 +47780,30 @@ class SubscribeAttributePowerSourceBatteryCommonDesignation : public SubscribeAt }; /* - * Attribute BatteryANSIDesignation + * Attribute AcceptedCommandList */ -class ReadPowerSourceBatteryANSIDesignation : public ReadAttribute { +class ReadKeypadInputAcceptedCommandList : public ReadAttribute { public: - ReadPowerSourceBatteryANSIDesignation() - : ReadAttribute("battery-ansidesignation") + ReadKeypadInputAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPowerSourceBatteryANSIDesignation() {} + ~ReadKeypadInputAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryANSIDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryANSIDesignation response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryANSIDesignation read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "KeypadInput AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44977,35 +47811,35 @@ class ReadPowerSourceBatteryANSIDesignation : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryANSIDesignation : public SubscribeAttribute { +class SubscribeAttributeKeypadInputAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryANSIDesignation() - : SubscribeAttribute("battery-ansidesignation") + SubscribeAttributeKeypadInputAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePowerSourceBatteryANSIDesignation() {} + ~SubscribeAttributeKeypadInputAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryANSIDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryANSIDesignation response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45017,30 +47851,30 @@ class SubscribeAttributePowerSourceBatteryANSIDesignation : public SubscribeAttr }; /* - * Attribute BatteryIECDesignation + * Attribute AttributeList */ -class ReadPowerSourceBatteryIECDesignation : public ReadAttribute { +class ReadKeypadInputAttributeList : public ReadAttribute { public: - ReadPowerSourceBatteryIECDesignation() - : ReadAttribute("battery-iecdesignation") + ReadKeypadInputAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPowerSourceBatteryIECDesignation() {} + ~ReadKeypadInputAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryIECDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryIECDesignation response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryIECDesignation read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "KeypadInput AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45048,35 +47882,34 @@ class ReadPowerSourceBatteryIECDesignation : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryIECDesignation : public SubscribeAttribute { +class SubscribeAttributeKeypadInputAttributeList : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryIECDesignation() - : SubscribeAttribute("battery-iecdesignation") + SubscribeAttributeKeypadInputAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePowerSourceBatteryIECDesignation() {} + ~SubscribeAttributeKeypadInputAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryIECDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryIECDesignation response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45088,68 +47921,65 @@ class SubscribeAttributePowerSourceBatteryIECDesignation : public SubscribeAttri }; /* - * Attribute BatteryApprovedChemistry + * Attribute FeatureMap */ -class ReadPowerSourceBatteryApprovedChemistry : public ReadAttribute { +class ReadKeypadInputFeatureMap : public ReadAttribute { public: - ReadPowerSourceBatteryApprovedChemistry() - : ReadAttribute("battery-approved-chemistry") + ReadKeypadInputFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPowerSourceBatteryApprovedChemistry() {} + ~ReadKeypadInputFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeBatteryApprovedChemistryWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryApprovedChemistry response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryApprovedChemistry read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "KeypadInput FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceBatteryApprovedChemistry : public SubscribeAttribute { +class SubscribeAttributeKeypadInputFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryApprovedChemistry() - : SubscribeAttribute("battery-approved-chemistry") + SubscribeAttributeKeypadInputFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePowerSourceBatteryApprovedChemistry() {} + ~SubscribeAttributeKeypadInputFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryApprovedChemistryWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryApprovedChemistry response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45161,30 +47991,30 @@ class SubscribeAttributePowerSourceBatteryApprovedChemistry : public SubscribeAt }; /* - * Attribute BatteryCapacity + * Attribute ClusterRevision */ -class ReadPowerSourceBatteryCapacity : public ReadAttribute { +class ReadKeypadInputClusterRevision : public ReadAttribute { public: - ReadPowerSourceBatteryCapacity() - : ReadAttribute("battery-capacity") + ReadKeypadInputClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPowerSourceBatteryCapacity() {} + ~ReadKeypadInputClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryCapacity response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryCapacity read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "KeypadInput ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45192,30 +48022,30 @@ class ReadPowerSourceBatteryCapacity : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryCapacity : public SubscribeAttribute { +class SubscribeAttributeKeypadInputClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryCapacity() - : SubscribeAttribute("battery-capacity") + SubscribeAttributeKeypadInputClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePowerSourceBatteryCapacity() {} + ~SubscribeAttributeKeypadInputClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryCapacityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryCapacity response %@", [value description]); + NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -45230,245 +48060,493 @@ class SubscribeAttributePowerSourceBatteryCapacity : public SubscribeAttribute { } }; +/*----------------------------------------------------------------------------*\ +| Cluster LevelControl | 0x0008 | +|------------------------------------------------------------------------------| +| Commands: | | +| * MoveToLevel | 0x00 | +| * Move | 0x01 | +| * Step | 0x02 | +| * Stop | 0x03 | +| * MoveToLevelWithOnOff | 0x04 | +| * MoveWithOnOff | 0x05 | +| * StepWithOnOff | 0x06 | +| * StopWithOnOff | 0x07 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentLevel | 0x0000 | +| * RemainingTime | 0x0001 | +| * MinLevel | 0x0002 | +| * MaxLevel | 0x0003 | +| * CurrentFrequency | 0x0004 | +| * MinFrequency | 0x0005 | +| * MaxFrequency | 0x0006 | +| * Options | 0x000F | +| * OnOffTransitionTime | 0x0010 | +| * OnLevel | 0x0011 | +| * OnTransitionTime | 0x0012 | +| * OffTransitionTime | 0x0013 | +| * DefaultMoveRate | 0x0014 | +| * StartUpCurrentLevel | 0x4000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute BatteryQuantity + * Command MoveToLevel */ -class ReadPowerSourceBatteryQuantity : public ReadAttribute { +class LevelControlMoveToLevel : public ClusterCommand { public: - ReadPowerSourceBatteryQuantity() - : ReadAttribute("battery-quantity") + LevelControlMoveToLevel() + : ClusterCommand("move-to-level") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Level", 0, UINT8_MAX, &mLevel); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); + AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); + ClusterCommand::AddArguments(); } - ~ReadPowerSourceBatteryQuantity() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryQuantityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryQuantity response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryQuantity read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.level = [NSNumber numberWithUnsignedChar:mLevel]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster moveToLevelWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type mRequest; + uint8_t mLevel; + uint16_t mTransitionTime; + uint8_t mOptionMask; + uint8_t mOptionOverride; }; -class SubscribeAttributePowerSourceBatteryQuantity : public SubscribeAttribute { +/* + * Command Move + */ +class LevelControlMove : public ClusterCommand { public: - SubscribeAttributePowerSourceBatteryQuantity() - : SubscribeAttribute("battery-quantity") + LevelControlMove() + : ClusterCommand("move") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); + AddArgument("Rate", 0, UINT8_MAX, &mRate); + AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); + AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); + ClusterCommand::AddArguments(); } - ~SubscribeAttributePowerSourceBatteryQuantity() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000019) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryQuantityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryQuantity response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000001) on endpoint %u", endpointId); - return CHIP_NO_ERROR; + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster moveWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::LevelControl::Commands::Move::Type mRequest; + uint8_t mMoveMode; + uint8_t mRate; + uint8_t mOptionMask; + uint8_t mOptionOverride; }; /* - * Attribute BatteryChargeState + * Command Step */ -class ReadPowerSourceBatteryChargeState : public ReadAttribute { +class LevelControlStep : public ClusterCommand { public: - ReadPowerSourceBatteryChargeState() - : ReadAttribute("battery-charge-state") + LevelControlStep() + : ClusterCommand("step") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); + AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); + AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); + ClusterCommand::AddArguments(); } - ~ReadPowerSourceBatteryChargeState() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryChargeState read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stepWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::LevelControl::Commands::Step::Type mRequest; + uint8_t mStepMode; + uint8_t mStepSize; + uint16_t mTransitionTime; + uint8_t mOptionMask; + uint8_t mOptionOverride; }; -class SubscribeAttributePowerSourceBatteryChargeState : public SubscribeAttribute { +/* + * Command Stop + */ +class LevelControlStop : public ClusterCommand { public: - SubscribeAttributePowerSourceBatteryChargeState() - : SubscribeAttribute("battery-charge-state") + LevelControlStop() + : ClusterCommand("stop") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask); + AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride); + ClusterCommand::AddArguments(); } - ~SubscribeAttributePowerSourceBatteryChargeState() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryChargeStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterStopParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stopWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::LevelControl::Commands::Stop::Type mRequest; + uint8_t mOptionMask; + uint8_t mOptionOverride; +}; + +/* + * Command MoveToLevelWithOnOff + */ +class LevelControlMoveToLevelWithOnOff : public ClusterCommand { +public: + LevelControlMoveToLevelWithOnOff() + : ClusterCommand("move-to-level-with-on-off") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Level", 0, UINT8_MAX, &mLevel); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.level = [NSNumber numberWithUnsignedChar:mLevel]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster moveToLevelWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type mRequest; + uint8_t mLevel; + uint16_t mTransitionTime; }; /* - * Attribute BatteryTimeToFullCharge + * Command MoveWithOnOff */ -class ReadPowerSourceBatteryTimeToFullCharge : public ReadAttribute { +class LevelControlMoveWithOnOff : public ClusterCommand { public: - ReadPowerSourceBatteryTimeToFullCharge() - : ReadAttribute("battery-time-to-full-charge") + LevelControlMoveWithOnOff() + : ClusterCommand("move-with-on-off") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode); + AddArgument("Rate", 0, UINT8_MAX, &mRate); + ClusterCommand::AddArguments(); } - ~ReadPowerSourceBatteryTimeToFullCharge() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeBatteryTimeToFullChargeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryTimeToFullCharge response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryTimeToFullCharge read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterMoveWithOnOffParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster moveWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type mRequest; + uint8_t mMoveMode; + uint8_t mRate; }; -class SubscribeAttributePowerSourceBatteryTimeToFullCharge : public SubscribeAttribute { +/* + * Command StepWithOnOff + */ +class LevelControlStepWithOnOff : public ClusterCommand { public: - SubscribeAttributePowerSourceBatteryTimeToFullCharge() - : SubscribeAttribute("battery-time-to-full-charge") + LevelControlStepWithOnOff() + : ClusterCommand("step-with-on-off") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("StepMode", 0, UINT8_MAX, &mStepMode); + AddArgument("StepSize", 0, UINT8_MAX, &mStepSize); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + ClusterCommand::AddArguments(); } - ~SubscribeAttributePowerSourceBatteryTimeToFullCharge() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryTimeToFullChargeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryTimeToFullCharge response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterStepWithOnOffParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stepWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type mRequest; + uint8_t mStepMode; + uint8_t mStepSize; + uint16_t mTransitionTime; +}; + +/* + * Command StopWithOnOff + */ +class LevelControlStopWithOnOff : public ClusterCommand { +public: + LevelControlStopWithOnOff() + : ClusterCommand("stop-with-on-off") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLevelControlClusterStopWithOnOffParams 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 stopWithOnOffWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type mRequest; }; /* - * Attribute BatteryFunctionalWhileCharging + * Attribute CurrentLevel */ -class ReadPowerSourceBatteryFunctionalWhileCharging : public ReadAttribute { +class ReadLevelControlCurrentLevel : public ReadAttribute { public: - ReadPowerSourceBatteryFunctionalWhileCharging() - : ReadAttribute("battery-functional-while-charging") + ReadLevelControlCurrentLevel() + : ReadAttribute("current-level") { } - ~ReadPowerSourceBatteryFunctionalWhileCharging() {} + ~ReadLevelControlCurrentLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryFunctionalWhileChargingWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryFunctionalWhileCharging response %@", [value description]); + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.CurrentLevel response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryFunctionalWhileCharging read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl CurrentLevel read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45476,40 +48554,37 @@ class ReadPowerSourceBatteryFunctionalWhileCharging : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryFunctionalWhileCharging : public SubscribeAttribute { +class SubscribeAttributeLevelControlCurrentLevel : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryFunctionalWhileCharging() - : SubscribeAttribute("battery-functional-while-charging") + SubscribeAttributeLevelControlCurrentLevel() + : SubscribeAttribute("current-level") { } - ~SubscribeAttributePowerSourceBatteryFunctionalWhileCharging() {} + ~SubscribeAttributeLevelControlCurrentLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryFunctionalWhileChargingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryFunctionalWhileCharging response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } + [cluster subscribeAttributeCurrentLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.CurrentLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } chip::System::Clock::Timeout GetWaitDuration() const override { @@ -45518,30 +48593,30 @@ class SubscribeAttributePowerSourceBatteryFunctionalWhileCharging : public Subsc }; /* - * Attribute BatteryChargingCurrent + * Attribute RemainingTime */ -class ReadPowerSourceBatteryChargingCurrent : public ReadAttribute { +class ReadLevelControlRemainingTime : public ReadAttribute { public: - ReadPowerSourceBatteryChargingCurrent() - : ReadAttribute("battery-charging-current") + ReadLevelControlRemainingTime() + : ReadAttribute("remaining-time") { } - ~ReadPowerSourceBatteryChargingCurrent() {} + ~ReadLevelControlRemainingTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryChargingCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargingCurrent response %@", [value description]); + [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.RemainingTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryChargingCurrent read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl RemainingTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45549,35 +48624,34 @@ class ReadPowerSourceBatteryChargingCurrent : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryChargingCurrent : public SubscribeAttribute { +class SubscribeAttributeLevelControlRemainingTime : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryChargingCurrent() - : SubscribeAttribute("battery-charging-current") + SubscribeAttributeLevelControlRemainingTime() + : SubscribeAttribute("remaining-time") { } - ~SubscribeAttributePowerSourceBatteryChargingCurrent() {} + ~SubscribeAttributeLevelControlRemainingTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBatteryChargingCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargingCurrent response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRemainingTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.RemainingTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45589,68 +48663,65 @@ class SubscribeAttributePowerSourceBatteryChargingCurrent : public SubscribeAttr }; /* - * Attribute ActiveBatteryChargeFaults + * Attribute MinLevel */ -class ReadPowerSourceActiveBatteryChargeFaults : public ReadAttribute { +class ReadLevelControlMinLevel : public ReadAttribute { public: - ReadPowerSourceActiveBatteryChargeFaults() - : ReadAttribute("active-battery-charge-faults") + ReadLevelControlMinLevel() + : ReadAttribute("min-level") { } - ~ReadPowerSourceActiveBatteryChargeFaults() {} + ~ReadLevelControlMinLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeActiveBatteryChargeFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveBatteryChargeFaults response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MinLevel response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource ActiveBatteryChargeFaults read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl MinLevel read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceActiveBatteryChargeFaults : public SubscribeAttribute { +class SubscribeAttributeLevelControlMinLevel : public SubscribeAttribute { public: - SubscribeAttributePowerSourceActiveBatteryChargeFaults() - : SubscribeAttribute("active-battery-charge-faults") + SubscribeAttributeLevelControlMinLevel() + : SubscribeAttribute("min-level") { } - ~SubscribeAttributePowerSourceActiveBatteryChargeFaults() {} + ~SubscribeAttributeLevelControlMinLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeActiveBatteryChargeFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveBatteryChargeFaults response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMinLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MinLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45662,30 +48733,30 @@ class SubscribeAttributePowerSourceActiveBatteryChargeFaults : public SubscribeA }; /* - * Attribute GeneratedCommandList + * Attribute MaxLevel */ -class ReadPowerSourceGeneratedCommandList : public ReadAttribute { +class ReadLevelControlMaxLevel : public ReadAttribute { public: - ReadPowerSourceGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadLevelControlMaxLevel() + : ReadAttribute("max-level") { } - ~ReadPowerSourceGeneratedCommandList() {} + ~ReadLevelControlMaxLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); + [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MaxLevel response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl MaxLevel read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45693,35 +48764,34 @@ class ReadPowerSourceGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributePowerSourceGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeLevelControlMaxLevel : public SubscribeAttribute { public: - SubscribeAttributePowerSourceGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeLevelControlMaxLevel() + : SubscribeAttribute("max-level") { } - ~SubscribeAttributePowerSourceGeneratedCommandList() {} + ~SubscribeAttributeLevelControlMaxLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMaxLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MaxLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45733,30 +48803,30 @@ class SubscribeAttributePowerSourceGeneratedCommandList : public SubscribeAttrib }; /* - * Attribute AcceptedCommandList + * Attribute CurrentFrequency */ -class ReadPowerSourceAcceptedCommandList : public ReadAttribute { +class ReadLevelControlCurrentFrequency : public ReadAttribute { public: - ReadPowerSourceAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadLevelControlCurrentFrequency() + : ReadAttribute("current-frequency") { } - ~ReadPowerSourceAcceptedCommandList() {} + ~ReadLevelControlCurrentFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); + [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl CurrentFrequency read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45764,35 +48834,34 @@ class ReadPowerSourceAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributePowerSourceAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeLevelControlCurrentFrequency : public SubscribeAttribute { public: - SubscribeAttributePowerSourceAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeLevelControlCurrentFrequency() + : SubscribeAttribute("current-frequency") { } - ~SubscribeAttributePowerSourceAcceptedCommandList() {} + ~SubscribeAttributeLevelControlCurrentFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCurrentFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45804,30 +48873,30 @@ class SubscribeAttributePowerSourceAcceptedCommandList : public SubscribeAttribu }; /* - * Attribute AttributeList + * Attribute MinFrequency */ -class ReadPowerSourceAttributeList : public ReadAttribute { +class ReadLevelControlMinFrequency : public ReadAttribute { public: - ReadPowerSourceAttributeList() - : ReadAttribute("attribute-list") + ReadLevelControlMinFrequency() + : ReadAttribute("min-frequency") { } - ~ReadPowerSourceAttributeList() {} + ~ReadLevelControlMinFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.AttributeList response %@", [value description]); + [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MinFrequency response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl MinFrequency read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45835,34 +48904,34 @@ class ReadPowerSourceAttributeList : public ReadAttribute { } }; -class SubscribeAttributePowerSourceAttributeList : public SubscribeAttribute { +class SubscribeAttributeLevelControlMinFrequency : public SubscribeAttribute { public: - SubscribeAttributePowerSourceAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeLevelControlMinFrequency() + : SubscribeAttribute("min-frequency") { } - ~SubscribeAttributePowerSourceAttributeList() {} + ~SubscribeAttributeLevelControlMinFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMinFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MinFrequency response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45874,30 +48943,30 @@ class SubscribeAttributePowerSourceAttributeList : public SubscribeAttribute { }; /* - * Attribute FeatureMap + * Attribute MaxFrequency */ -class ReadPowerSourceFeatureMap : public ReadAttribute { +class ReadLevelControlMaxFrequency : public ReadAttribute { public: - ReadPowerSourceFeatureMap() - : ReadAttribute("feature-map") + ReadLevelControlMaxFrequency() + : ReadAttribute("max-frequency") { } - ~ReadPowerSourceFeatureMap() {} + ~ReadLevelControlMaxFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.FeatureMap response %@", [value description]); + [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MaxFrequency response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl MaxFrequency read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45905,34 +48974,34 @@ class ReadPowerSourceFeatureMap : public ReadAttribute { } }; -class SubscribeAttributePowerSourceFeatureMap : public SubscribeAttribute { +class SubscribeAttributeLevelControlMaxFrequency : public SubscribeAttribute { public: - SubscribeAttributePowerSourceFeatureMap() - : SubscribeAttribute("feature-map") + SubscribeAttributeLevelControlMaxFrequency() + : SubscribeAttribute("max-frequency") { } - ~SubscribeAttributePowerSourceFeatureMap() {} + ~SubscribeAttributeLevelControlMaxFrequency() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.FeatureMap response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMaxFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.MaxFrequency response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -45944,30 +49013,30 @@ class SubscribeAttributePowerSourceFeatureMap : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute Options */ -class ReadPowerSourceClusterRevision : public ReadAttribute { +class ReadLevelControlOptions : public ReadAttribute { public: - ReadPowerSourceClusterRevision() - : ReadAttribute("cluster-revision") + ReadLevelControlOptions() + : ReadAttribute("options") { } - ~ReadPowerSourceClusterRevision() {} + ~ReadLevelControlOptions() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000000F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ClusterRevision response %@", [value description]); + [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.Options response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl Options read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -45975,120 +49044,69 @@ class ReadPowerSourceClusterRevision : public ReadAttribute { } }; -class SubscribeAttributePowerSourceClusterRevision : public SubscribeAttribute { +class WriteLevelControlOptions : public WriteAttribute { public: - SubscribeAttributePowerSourceClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteLevelControlOptions() + : WriteAttribute("options") { + AddArgument("attr-name", "options"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePowerSourceClusterRevision() {} + ~WriteLevelControlOptions() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x0000000F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } -}; - -/*----------------------------------------------------------------------------*\ -| Cluster PowerSourceConfiguration | 0x002E | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Sources | 0x0000 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; -/* - * Attribute Sources - */ -class ReadPowerSourceConfigurationSources : public ReadAttribute { -public: - ReadPowerSourceConfigurationSources() - : ReadAttribute("sources") - { + [cluster writeAttributeOptionsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl Options write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; } - ~ReadPowerSourceConfigurationSources() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSourcesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PowerSourceConfiguration Sources read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } +private: + uint8_t mValue; }; -class SubscribeAttributePowerSourceConfigurationSources : public SubscribeAttribute { +class SubscribeAttributeLevelControlOptions : public SubscribeAttribute { public: - SubscribeAttributePowerSourceConfigurationSources() - : SubscribeAttribute("sources") + SubscribeAttributeLevelControlOptions() + : SubscribeAttribute("options") { } - ~SubscribeAttributePowerSourceConfigurationSources() {} + ~SubscribeAttributeLevelControlOptions() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000000F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSourcesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeOptionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.Options response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -46104,32 +49122,30 @@ class SubscribeAttributePowerSourceConfigurationSources : public SubscribeAttrib }; /* - * Attribute GeneratedCommandList + * Attribute OnOffTransitionTime */ -class ReadPowerSourceConfigurationGeneratedCommandList : public ReadAttribute { +class ReadLevelControlOnOffTransitionTime : public ReadAttribute { public: - ReadPowerSourceConfigurationGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadLevelControlOnOffTransitionTime() + : ReadAttribute("on-off-transition-time") { } - ~ReadPowerSourceConfigurationGeneratedCommandList() {} + ~ReadLevelControlOnOffTransitionTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", [value description]); + [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSourceConfiguration GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl OnOffTransitionTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46137,37 +49153,75 @@ class ReadPowerSourceConfigurationGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributePowerSourceConfigurationGeneratedCommandList : public SubscribeAttribute { +class WriteLevelControlOnOffTransitionTime : public WriteAttribute { public: - SubscribeAttributePowerSourceConfigurationGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteLevelControlOnOffTransitionTime() + : WriteAttribute("on-off-transition-time") { - } - - ~SubscribeAttributePowerSourceConfigurationGeneratedCommandList() {} + AddArgument("attr-name", "on-off-transition-time"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteLevelControlOnOffTransitionTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeOnOffTransitionTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl OnOffTransitionTime write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeLevelControlOnOffTransitionTime : public SubscribeAttribute { +public: + SubscribeAttributeLevelControlOnOffTransitionTime() + : SubscribeAttribute("on-off-transition-time") + { + } + + ~SubscribeAttributeLevelControlOnOffTransitionTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeOnOffTransitionTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46179,32 +49233,30 @@ class SubscribeAttributePowerSourceConfigurationGeneratedCommandList : public Su }; /* - * Attribute AcceptedCommandList + * Attribute OnLevel */ -class ReadPowerSourceConfigurationAcceptedCommandList : public ReadAttribute { +class ReadLevelControlOnLevel : public ReadAttribute { public: - ReadPowerSourceConfigurationAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadLevelControlOnLevel() + : ReadAttribute("on-level") { } - ~ReadPowerSourceConfigurationAcceptedCommandList() {} + ~ReadLevelControlOnLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", [value description]); + [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OnLevel response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSourceConfiguration AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl OnLevel read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46212,37 +49264,73 @@ class ReadPowerSourceConfigurationAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributePowerSourceConfigurationAcceptedCommandList : public SubscribeAttribute { +class WriteLevelControlOnLevel : public WriteAttribute { public: - SubscribeAttributePowerSourceConfigurationAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteLevelControlOnLevel() + : WriteAttribute("on-level") { + AddArgument("attr-name", "on-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePowerSourceConfigurationAcceptedCommandList() {} + ~WriteLevelControlOnLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeOnLevelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl OnLevel write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { +public: + SubscribeAttributeLevelControlOnLevel() + : SubscribeAttribute("on-level") + { + } + + ~SubscribeAttributeLevelControlOnLevel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOnLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OnLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46254,32 +49342,30 @@ class SubscribeAttributePowerSourceConfigurationAcceptedCommandList : public Sub }; /* - * Attribute AttributeList + * Attribute OnTransitionTime */ -class ReadPowerSourceConfigurationAttributeList : public ReadAttribute { +class ReadLevelControlOnTransitionTime : public ReadAttribute { public: - ReadPowerSourceConfigurationAttributeList() - : ReadAttribute("attribute-list") + ReadLevelControlOnTransitionTime() + : ReadAttribute("on-transition-time") { } - ~ReadPowerSourceConfigurationAttributeList() {} + ~ReadLevelControlOnTransitionTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); + [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSourceConfiguration AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl OnTransitionTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46287,37 +49373,74 @@ class ReadPowerSourceConfigurationAttributeList : public ReadAttribute { } }; -class SubscribeAttributePowerSourceConfigurationAttributeList : public SubscribeAttribute { +class WriteLevelControlOnTransitionTime : public WriteAttribute { public: - SubscribeAttributePowerSourceConfigurationAttributeList() - : SubscribeAttribute("attribute-list") + WriteLevelControlOnTransitionTime() + : WriteAttribute("on-transition-time") { + AddArgument("attr-name", "on-transition-time"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePowerSourceConfigurationAttributeList() {} + ~WriteLevelControlOnTransitionTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeOnTransitionTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl OnTransitionTime write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute { +public: + SubscribeAttributeLevelControlOnTransitionTime() + : SubscribeAttribute("on-transition-time") + { + } + + ~SubscribeAttributeLevelControlOnTransitionTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOnTransitionTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46329,32 +49452,30 @@ class SubscribeAttributePowerSourceConfigurationAttributeList : public Subscribe }; /* - * Attribute ClusterRevision + * Attribute OffTransitionTime */ -class ReadPowerSourceConfigurationClusterRevision : public ReadAttribute { +class ReadLevelControlOffTransitionTime : public ReadAttribute { public: - ReadPowerSourceConfigurationClusterRevision() - : ReadAttribute("cluster-revision") + ReadLevelControlOffTransitionTime() + : ReadAttribute("off-transition-time") { } - ~ReadPowerSourceConfigurationClusterRevision() {} + ~ReadLevelControlOffTransitionTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", [value description]); + [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSourceConfiguration ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl OffTransitionTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46362,37 +49483,74 @@ class ReadPowerSourceConfigurationClusterRevision : public ReadAttribute { } }; -class SubscribeAttributePowerSourceConfigurationClusterRevision : public SubscribeAttribute { +class WriteLevelControlOffTransitionTime : public WriteAttribute { public: - SubscribeAttributePowerSourceConfigurationClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteLevelControlOffTransitionTime() + : WriteAttribute("off-transition-time") { + AddArgument("attr-name", "off-transition-time"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePowerSourceConfigurationClusterRevision() {} + ~WriteLevelControlOffTransitionTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeOffTransitionTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl OffTransitionTime write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribute { +public: + SubscribeAttributeLevelControlOffTransitionTime() + : SubscribeAttribute("off-transition-time") + { + } + + ~SubscribeAttributeLevelControlOffTransitionTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOffTransitionTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46403,57 +49561,31 @@ class SubscribeAttributePowerSourceConfigurationClusterRevision : public Subscri } }; -/*----------------------------------------------------------------------------*\ -| Cluster PressureMeasurement | 0x0403 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * ScaledValue | 0x0010 | -| * MinScaledValue | 0x0011 | -| * MaxScaledValue | 0x0012 | -| * ScaledTolerance | 0x0013 | -| * Scale | 0x0014 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute MeasuredValue + * Attribute DefaultMoveRate */ -class ReadPressureMeasurementMeasuredValue : public ReadAttribute { +class ReadLevelControlDefaultMoveRate : public ReadAttribute { public: - ReadPressureMeasurementMeasuredValue() - : ReadAttribute("measured-value") + ReadLevelControlDefaultMoveRate() + : ReadAttribute("default-move-rate") { } - ~ReadPressureMeasurementMeasuredValue() {} + ~ReadLevelControlDefaultMoveRate() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); + [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl DefaultMoveRate read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46461,36 +49593,74 @@ class ReadPressureMeasurementMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementMeasuredValue : public SubscribeAttribute { +class WriteLevelControlDefaultMoveRate : public WriteAttribute { public: - SubscribeAttributePressureMeasurementMeasuredValue() - : SubscribeAttribute("measured-value") + WriteLevelControlDefaultMoveRate() + : WriteAttribute("default-move-rate") { + AddArgument("attr-name", "default-move-rate"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePressureMeasurementMeasuredValue() {} + ~WriteLevelControlDefaultMoveRate() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeDefaultMoveRateWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl DefaultMoveRate write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute { +public: + SubscribeAttributeLevelControlDefaultMoveRate() + : SubscribeAttribute("default-move-rate") + { + } + + ~SubscribeAttributeLevelControlDefaultMoveRate() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDefaultMoveRateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46502,32 +49672,30 @@ class SubscribeAttributePressureMeasurementMeasuredValue : public SubscribeAttri }; /* - * Attribute MinMeasuredValue + * Attribute StartUpCurrentLevel */ -class ReadPressureMeasurementMinMeasuredValue : public ReadAttribute { +class ReadLevelControlStartUpCurrentLevel : public ReadAttribute { public: - ReadPressureMeasurementMinMeasuredValue() - : ReadAttribute("min-measured-value") + ReadLevelControlStartUpCurrentLevel() + : ReadAttribute("start-up-current-level") { } - ~ReadPressureMeasurementMinMeasuredValue() {} + ~ReadLevelControlStartUpCurrentLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); + [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl StartUpCurrentLevel read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46535,37 +49703,75 @@ class ReadPressureMeasurementMinMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementMinMeasuredValue : public SubscribeAttribute { +class WriteLevelControlStartUpCurrentLevel : public WriteAttribute { public: - SubscribeAttributePressureMeasurementMinMeasuredValue() - : SubscribeAttribute("min-measured-value") + WriteLevelControlStartUpCurrentLevel() + : WriteAttribute("start-up-current-level") { - } - - ~SubscribeAttributePressureMeasurementMinMeasuredValue() {} + AddArgument("attr-name", "start-up-current-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteLevelControlStartUpCurrentLevel() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeStartUpCurrentLevelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LevelControl StartUpCurrentLevel write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttribute { +public: + SubscribeAttributeLevelControlStartUpCurrentLevel() + : SubscribeAttribute("start-up-current-level") + { + } + + ~SubscribeAttributeLevelControlStartUpCurrentLevel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00004000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeStartUpCurrentLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46577,32 +49783,30 @@ class SubscribeAttributePressureMeasurementMinMeasuredValue : public SubscribeAt }; /* - * Attribute MaxMeasuredValue + * Attribute GeneratedCommandList */ -class ReadPressureMeasurementMaxMeasuredValue : public ReadAttribute { +class ReadLevelControlGeneratedCommandList : public ReadAttribute { public: - ReadPressureMeasurementMaxMeasuredValue() - : ReadAttribute("max-measured-value") + ReadLevelControlGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadPressureMeasurementMaxMeasuredValue() {} + ~ReadLevelControlGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46610,37 +49814,35 @@ class ReadPressureMeasurementMaxMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementMaxMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeLevelControlGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementMaxMeasuredValue() - : SubscribeAttribute("max-measured-value") + SubscribeAttributeLevelControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePressureMeasurementMaxMeasuredValue() {} + ~SubscribeAttributeLevelControlGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46652,32 +49854,30 @@ class SubscribeAttributePressureMeasurementMaxMeasuredValue : public SubscribeAt }; /* - * Attribute Tolerance + * Attribute AcceptedCommandList */ -class ReadPressureMeasurementTolerance : public ReadAttribute { +class ReadLevelControlAcceptedCommandList : public ReadAttribute { public: - ReadPressureMeasurementTolerance() - : ReadAttribute("tolerance") + ReadLevelControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPressureMeasurementTolerance() {} + ~ReadLevelControlAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46685,36 +49885,35 @@ class ReadPressureMeasurementTolerance : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementTolerance : public SubscribeAttribute { +class SubscribeAttributeLevelControlAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementTolerance() - : SubscribeAttribute("tolerance") + SubscribeAttributeLevelControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePressureMeasurementTolerance() {} + ~SubscribeAttributeLevelControlAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46726,32 +49925,30 @@ class SubscribeAttributePressureMeasurementTolerance : public SubscribeAttribute }; /* - * Attribute ScaledValue + * Attribute AttributeList */ -class ReadPressureMeasurementScaledValue : public ReadAttribute { +class ReadLevelControlAttributeList : public ReadAttribute { public: - ReadPressureMeasurementScaledValue() - : ReadAttribute("scaled-value") + ReadLevelControlAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPressureMeasurementScaledValue() {} + ~ReadLevelControlAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement ScaledValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46759,36 +49956,34 @@ class ReadPressureMeasurementScaledValue : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementScaledValue : public SubscribeAttribute { +class SubscribeAttributeLevelControlAttributeList : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementScaledValue() - : SubscribeAttribute("scaled-value") + SubscribeAttributeLevelControlAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePressureMeasurementScaledValue() {} + ~SubscribeAttributeLevelControlAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeScaledValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46800,32 +49995,30 @@ class SubscribeAttributePressureMeasurementScaledValue : public SubscribeAttribu }; /* - * Attribute MinScaledValue + * Attribute FeatureMap */ -class ReadPressureMeasurementMinScaledValue : public ReadAttribute { +class ReadLevelControlFeatureMap : public ReadAttribute { public: - ReadPressureMeasurementMinScaledValue() - : ReadAttribute("min-scaled-value") + ReadLevelControlFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPressureMeasurementMinScaledValue() {} + ~ReadLevelControlFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement MinScaledValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46833,37 +50026,34 @@ class ReadPressureMeasurementMinScaledValue : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementMinScaledValue : public SubscribeAttribute { +class SubscribeAttributeLevelControlFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementMinScaledValue() - : SubscribeAttribute("min-scaled-value") + SubscribeAttributeLevelControlFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePressureMeasurementMinScaledValue() {} + ~SubscribeAttributeLevelControlFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMinScaledValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46875,32 +50065,30 @@ class SubscribeAttributePressureMeasurementMinScaledValue : public SubscribeAttr }; /* - * Attribute MaxScaledValue + * Attribute ClusterRevision */ -class ReadPressureMeasurementMaxScaledValue : public ReadAttribute { +class ReadLevelControlClusterRevision : public ReadAttribute { public: - ReadPressureMeasurementMaxScaledValue() - : ReadAttribute("max-scaled-value") + ReadLevelControlClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPressureMeasurementMaxScaledValue() {} + ~ReadLevelControlClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement MaxScaledValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LevelControl ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46908,37 +50096,34 @@ class ReadPressureMeasurementMaxScaledValue : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementMaxScaledValue : public SubscribeAttribute { +class SubscribeAttributeLevelControlClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementMaxScaledValue() - : SubscribeAttribute("max-scaled-value") + SubscribeAttributeLevelControlClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePressureMeasurementMaxScaledValue() {} + ~SubscribeAttributeLevelControlClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMaxScaledValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LevelControl.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -46949,33 +50134,50 @@ class SubscribeAttributePressureMeasurementMaxScaledValue : public SubscribeAttr } }; +/*----------------------------------------------------------------------------*\ +| Cluster LocalizationConfiguration | 0x002B | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ActiveLocale | 0x0001 | +| * SupportedLocales | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute ScaledTolerance + * Attribute ActiveLocale */ -class ReadPressureMeasurementScaledTolerance : public ReadAttribute { +class ReadLocalizationConfigurationActiveLocale : public ReadAttribute { public: - ReadPressureMeasurementScaledTolerance() - : ReadAttribute("scaled-tolerance") + ReadLocalizationConfigurationActiveLocale() + : ReadAttribute("active-locale") { } - ~ReadPressureMeasurementScaledTolerance() {} + ~ReadLocalizationConfigurationActiveLocale() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeScaledToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); + [cluster readAttributeActiveLocaleWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement ScaledTolerance read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration ActiveLocale read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -46983,37 +50185,81 @@ class ReadPressureMeasurementScaledTolerance : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementScaledTolerance : public SubscribeAttribute { +class WriteLocalizationConfigurationActiveLocale : public WriteAttribute { public: - SubscribeAttributePressureMeasurementScaledTolerance() - : SubscribeAttribute("scaled-tolerance") + WriteLocalizationConfigurationActiveLocale() + : WriteAttribute("active-locale") { + AddArgument("attr-name", "active-locale"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributePressureMeasurementScaledTolerance() {} + ~WriteLocalizationConfigurationActiveLocale() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) WriteAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeActiveLocaleWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "LocalizationConfiguration ActiveLocale write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeLocalizationConfigurationActiveLocale : public SubscribeAttribute { +public: + SubscribeAttributeLocalizationConfigurationActiveLocale() + : SubscribeAttribute("active-locale") + { + } + + ~SubscribeAttributeLocalizationConfigurationActiveLocale() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeScaledToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeActiveLocaleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47025,32 +50271,32 @@ class SubscribeAttributePressureMeasurementScaledTolerance : public SubscribeAtt }; /* - * Attribute Scale + * Attribute SupportedLocales */ -class ReadPressureMeasurementScale : public ReadAttribute { +class ReadLocalizationConfigurationSupportedLocales : public ReadAttribute { public: - ReadPressureMeasurementScale() - : ReadAttribute("scale") + ReadLocalizationConfigurationSupportedLocales() + : ReadAttribute("supported-locales") { } - ~ReadPressureMeasurementScale() {} + ~ReadLocalizationConfigurationSupportedLocales() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeScaleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.Scale response %@", [value description]); + [cluster readAttributeSupportedLocalesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.SupportedLocales response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement Scale read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration SupportedLocales read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47058,36 +50304,37 @@ class ReadPressureMeasurementScale : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementScale : public SubscribeAttribute { +class SubscribeAttributeLocalizationConfigurationSupportedLocales : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementScale() - : SubscribeAttribute("scale") + SubscribeAttributeLocalizationConfigurationSupportedLocales() + : SubscribeAttribute("supported-locales") { } - ~SubscribeAttributePressureMeasurementScale() {} + ~SubscribeAttributeLocalizationConfigurationSupportedLocales() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeScaleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.Scale response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSupportedLocalesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.SupportedLocales response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47099,32 +50346,32 @@ class SubscribeAttributePressureMeasurementScale : public SubscribeAttribute { }; /* - * Attribute AttributeList + * Attribute GeneratedCommandList */ -class ReadPressureMeasurementAttributeList : public ReadAttribute { +class ReadLocalizationConfigurationGeneratedCommandList : public ReadAttribute { public: - ReadPressureMeasurementAttributeList() - : ReadAttribute("attribute-list") + ReadLocalizationConfigurationGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadPressureMeasurementAttributeList() {} + ~ReadLocalizationConfigurationGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47132,36 +50379,37 @@ class ReadPressureMeasurementAttributeList : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementAttributeList : public SubscribeAttribute { +class SubscribeAttributeLocalizationConfigurationGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeLocalizationConfigurationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePressureMeasurementAttributeList() {} + ~SubscribeAttributeLocalizationConfigurationGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47173,32 +50421,32 @@ class SubscribeAttributePressureMeasurementAttributeList : public SubscribeAttri }; /* - * Attribute ClusterRevision + * Attribute AcceptedCommandList */ -class ReadPressureMeasurementClusterRevision : public ReadAttribute { +class ReadLocalizationConfigurationAcceptedCommandList : public ReadAttribute { public: - ReadPressureMeasurementClusterRevision() - : ReadAttribute("cluster-revision") + ReadLocalizationConfigurationAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPressureMeasurementClusterRevision() {} + ~ReadLocalizationConfigurationAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PressureMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47206,37 +50454,37 @@ class ReadPressureMeasurementClusterRevision : public ReadAttribute { } }; -class SubscribeAttributePressureMeasurementClusterRevision : public SubscribeAttribute { +class SubscribeAttributeLocalizationConfigurationAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePressureMeasurementClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeLocalizationConfigurationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePressureMeasurementClusterRevision() {} + ~SubscribeAttributeLocalizationConfigurationAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47247,89 +50495,33 @@ class SubscribeAttributePressureMeasurementClusterRevision : public SubscribeAtt } }; -/*----------------------------------------------------------------------------*\ -| Cluster PumpConfigurationAndControl | 0x0200 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MaxPressure | 0x0000 | -| * MaxSpeed | 0x0001 | -| * MaxFlow | 0x0002 | -| * MinConstPressure | 0x0003 | -| * MaxConstPressure | 0x0004 | -| * MinCompPressure | 0x0005 | -| * MaxCompPressure | 0x0006 | -| * MinConstSpeed | 0x0007 | -| * MaxConstSpeed | 0x0008 | -| * MinConstFlow | 0x0009 | -| * MaxConstFlow | 0x000A | -| * MinConstTemp | 0x000B | -| * MaxConstTemp | 0x000C | -| * PumpStatus | 0x0010 | -| * EffectiveOperationMode | 0x0011 | -| * EffectiveControlMode | 0x0012 | -| * Capacity | 0x0013 | -| * Speed | 0x0014 | -| * LifetimeRunningHours | 0x0015 | -| * Power | 0x0016 | -| * LifetimeEnergyConsumed | 0x0017 | -| * OperationMode | 0x0020 | -| * ControlMode | 0x0021 | -| * AlarmMask | 0x0022 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * SupplyVoltageLow | 0x0000 | -| * SupplyVoltageHigh | 0x0001 | -| * PowerMissingPhase | 0x0002 | -| * SystemPressureLow | 0x0003 | -| * SystemPressureHigh | 0x0004 | -| * DryRunning | 0x0005 | -| * MotorTemperatureHigh | 0x0006 | -| * PumpMotorFatalFailure | 0x0007 | -| * ElectronicTemperatureHigh | 0x0008 | -| * PumpBlocked | 0x0009 | -| * SensorFailure | 0x000A | -| * ElectronicNonFatalFailure | 0x000B | -| * ElectronicFatalFailure | 0x000C | -| * GeneralFault | 0x000D | -| * Leakage | 0x000E | -| * AirDetection | 0x000F | -| * TurbineOperation | 0x0010 | -\*----------------------------------------------------------------------------*/ - /* - * Attribute MaxPressure + * Attribute AttributeList */ -class ReadPumpConfigurationAndControlMaxPressure : public ReadAttribute { +class ReadLocalizationConfigurationAttributeList : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxPressure() - : ReadAttribute("max-pressure") + ReadLocalizationConfigurationAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPumpConfigurationAndControlMaxPressure() {} + ~ReadLocalizationConfigurationAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxPressure read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47337,37 +50529,37 @@ class ReadPumpConfigurationAndControlMaxPressure : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxPressure : public SubscribeAttribute { +class SubscribeAttributeLocalizationConfigurationAttributeList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxPressure() - : SubscribeAttribute("max-pressure") + SubscribeAttributeLocalizationConfigurationAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePumpConfigurationAndControlMaxPressure() {} + ~SubscribeAttributeLocalizationConfigurationAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeMaxPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47379,32 +50571,32 @@ class SubscribeAttributePumpConfigurationAndControlMaxPressure : public Subscrib }; /* - * Attribute MaxSpeed + * Attribute FeatureMap */ -class ReadPumpConfigurationAndControlMaxSpeed : public ReadAttribute { +class ReadLocalizationConfigurationFeatureMap : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxSpeed() - : ReadAttribute("max-speed") + ReadLocalizationConfigurationFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPumpConfigurationAndControlMaxSpeed() {} + ~ReadLocalizationConfigurationFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxSpeed read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47412,36 +50604,36 @@ class ReadPumpConfigurationAndControlMaxSpeed : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxSpeed : public SubscribeAttribute { +class SubscribeAttributeLocalizationConfigurationFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxSpeed() - : SubscribeAttribute("max-speed") + SubscribeAttributeLocalizationConfigurationFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePumpConfigurationAndControlMaxSpeed() {} + ~SubscribeAttributeLocalizationConfigurationFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47453,32 +50645,32 @@ class SubscribeAttributePumpConfigurationAndControlMaxSpeed : public SubscribeAt }; /* - * Attribute MaxFlow + * Attribute ClusterRevision */ -class ReadPumpConfigurationAndControlMaxFlow : public ReadAttribute { +class ReadLocalizationConfigurationClusterRevision : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxFlow() - : ReadAttribute("max-flow") + ReadLocalizationConfigurationClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPumpConfigurationAndControlMaxFlow() {} + ~ReadLocalizationConfigurationClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxFlow read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LocalizationConfiguration ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47486,36 +50678,37 @@ class ReadPumpConfigurationAndControlMaxFlow : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxFlow : public SubscribeAttribute { +class SubscribeAttributeLocalizationConfigurationClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxFlow() - : SubscribeAttribute("max-flow") + SubscribeAttributeLocalizationConfigurationClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePumpConfigurationAndControlMaxFlow() {} + ~SubscribeAttributeLocalizationConfigurationClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxFlowWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LocalizationConfiguration.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47526,33 +50719,91 @@ class SubscribeAttributePumpConfigurationAndControlMaxFlow : public SubscribeAtt } }; +/*----------------------------------------------------------------------------*\ +| Cluster LowPower | 0x0508 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Sleep | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute MinConstPressure + * Command Sleep */ -class ReadPumpConfigurationAndControlMinConstPressure : public ReadAttribute { +class LowPowerSleep : public ClusterCommand { public: - ReadPumpConfigurationAndControlMinConstPressure() - : ReadAttribute("min-const-pressure") + LowPowerSleep() + : ClusterCommand("sleep") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~ReadPumpConfigurationAndControlMinConstPressure() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000508) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPLowPowerClusterSleepParams 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 sleepWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::LowPower::Commands::Sleep::Type mRequest; +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadLowPowerGeneratedCommandList : public ReadAttribute { +public: + ReadLowPowerGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadLowPowerGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MinConstPressure read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LowPower GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47560,37 +50811,35 @@ class ReadPumpConfigurationAndControlMinConstPressure : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMinConstPressure : public SubscribeAttribute { +class SubscribeAttributeLowPowerGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMinConstPressure() - : SubscribeAttribute("min-const-pressure") + SubscribeAttributeLowPowerGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePumpConfigurationAndControlMinConstPressure() {} + ~SubscribeAttributeLowPowerGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinConstPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47602,32 +50851,30 @@ class SubscribeAttributePumpConfigurationAndControlMinConstPressure : public Sub }; /* - * Attribute MaxConstPressure + * Attribute AcceptedCommandList */ -class ReadPumpConfigurationAndControlMaxConstPressure : public ReadAttribute { +class ReadLowPowerAcceptedCommandList : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxConstPressure() - : ReadAttribute("max-const-pressure") + ReadLowPowerAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPumpConfigurationAndControlMaxConstPressure() {} + ~ReadLowPowerAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstPressure read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LowPower AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47635,37 +50882,34 @@ class ReadPumpConfigurationAndControlMaxConstPressure : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxConstPressure : public SubscribeAttribute { +class SubscribeAttributeLowPowerAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxConstPressure() - : SubscribeAttribute("max-const-pressure") + SubscribeAttributeLowPowerAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePumpConfigurationAndControlMaxConstPressure() {} + ~SubscribeAttributeLowPowerAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxConstPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47677,32 +50921,30 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstPressure : public Sub }; /* - * Attribute MinCompPressure + * Attribute AttributeList */ -class ReadPumpConfigurationAndControlMinCompPressure : public ReadAttribute { +class ReadLowPowerAttributeList : public ReadAttribute { public: - ReadPumpConfigurationAndControlMinCompPressure() - : ReadAttribute("min-comp-pressure") + ReadLowPowerAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPumpConfigurationAndControlMinCompPressure() {} + ~ReadLowPowerAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MinCompPressure read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LowPower AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47710,37 +50952,34 @@ class ReadPumpConfigurationAndControlMinCompPressure : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMinCompPressure : public SubscribeAttribute { +class SubscribeAttributeLowPowerAttributeList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMinCompPressure() - : SubscribeAttribute("min-comp-pressure") + SubscribeAttributeLowPowerAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePumpConfigurationAndControlMinCompPressure() {} + ~SubscribeAttributeLowPowerAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinCompPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47752,32 +50991,30 @@ class SubscribeAttributePumpConfigurationAndControlMinCompPressure : public Subs }; /* - * Attribute MaxCompPressure + * Attribute FeatureMap */ -class ReadPumpConfigurationAndControlMaxCompPressure : public ReadAttribute { +class ReadLowPowerFeatureMap : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxCompPressure() - : ReadAttribute("max-comp-pressure") + ReadLowPowerFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPumpConfigurationAndControlMaxCompPressure() {} + ~ReadLowPowerFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxCompPressure read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LowPower FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47785,37 +51022,34 @@ class ReadPumpConfigurationAndControlMaxCompPressure : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxCompPressure : public SubscribeAttribute { +class SubscribeAttributeLowPowerFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxCompPressure() - : SubscribeAttribute("max-comp-pressure") + SubscribeAttributeLowPowerFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePumpConfigurationAndControlMaxCompPressure() {} + ~SubscribeAttributeLowPowerFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxCompPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47827,32 +51061,30 @@ class SubscribeAttributePumpConfigurationAndControlMaxCompPressure : public Subs }; /* - * Attribute MinConstSpeed + * Attribute ClusterRevision */ -class ReadPumpConfigurationAndControlMinConstSpeed : public ReadAttribute { +class ReadLowPowerClusterRevision : public ReadAttribute { public: - ReadPumpConfigurationAndControlMinConstSpeed() - : ReadAttribute("min-const-speed") + ReadLowPowerClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPumpConfigurationAndControlMinConstSpeed() {} + ~ReadLowPowerClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MinConstSpeed read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "LowPower ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -47860,37 +51092,34 @@ class ReadPumpConfigurationAndControlMinConstSpeed : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMinConstSpeed : public SubscribeAttribute { +class SubscribeAttributeLowPowerClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMinConstSpeed() - : SubscribeAttribute("min-const-speed") + SubscribeAttributeLowPowerClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePumpConfigurationAndControlMinConstSpeed() {} + ~SubscribeAttributeLowPowerClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinConstSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"LowPower.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -47901,108 +51130,239 @@ class SubscribeAttributePumpConfigurationAndControlMinConstSpeed : public Subscr } }; +/*----------------------------------------------------------------------------*\ +| Cluster MediaInput | 0x0507 | +|------------------------------------------------------------------------------| +| Commands: | | +| * SelectInput | 0x00 | +| * ShowInputStatus | 0x01 | +| * HideInputStatus | 0x02 | +| * RenameInput | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * InputList | 0x0000 | +| * CurrentInput | 0x0001 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute MaxConstSpeed + * Command SelectInput */ -class ReadPumpConfigurationAndControlMaxConstSpeed : public ReadAttribute { +class MediaInputSelectInput : public ClusterCommand { public: - ReadPumpConfigurationAndControlMaxConstSpeed() - : ReadAttribute("max-const-speed") + MediaInputSelectInput() + : ClusterCommand("select-input") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Index", 0, UINT8_MAX, &mIndex); + ClusterCommand::AddArguments(); } - ~ReadPumpConfigurationAndControlMaxConstSpeed() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstSpeed read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaInputClusterSelectInputParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.index = [NSNumber numberWithUnsignedChar:mIndex]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster selectInputWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaInput::Commands::SelectInput::Type mRequest; + uint8_t mIndex; }; -class SubscribeAttributePumpConfigurationAndControlMaxConstSpeed : public SubscribeAttribute { +/* + * Command ShowInputStatus + */ +class MediaInputShowInputStatus : public ClusterCommand { public: - SubscribeAttributePumpConfigurationAndControlMaxConstSpeed() - : SubscribeAttribute("max-const-speed") + MediaInputShowInputStatus() + : ClusterCommand("show-input-status") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~SubscribeAttributePumpConfigurationAndControlMaxConstSpeed() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaInputClusterShowInputStatusParams 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 showInputStatusWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type mRequest; +}; + +/* + * Command HideInputStatus + */ +class MediaInputHideInputStatus : public ClusterCommand { +public: + MediaInputHideInputStatus() + : ClusterCommand("hide-input-status") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxConstSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaInputClusterHideInputStatusParams 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 hideInputStatusWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type mRequest; +}; + +/* + * Command RenameInput + */ +class MediaInputRenameInput : public ClusterCommand { +public: + MediaInputRenameInput() + : ClusterCommand("rename-input") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Index", 0, UINT8_MAX, &mIndex); + AddArgument("Name", &mName); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaInputClusterRenameInputParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.index = [NSNumber numberWithUnsignedChar:mIndex]; + params.name = [[NSString alloc] initWithBytes:mName.data() length:mName.size() encoding:NSUTF8StringEncoding]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster renameInputWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaInput::Commands::RenameInput::Type mRequest; + uint8_t mIndex; + chip::ByteSpan mName; }; /* - * Attribute MinConstFlow + * Attribute InputList */ -class ReadPumpConfigurationAndControlMinConstFlow : public ReadAttribute { +class ReadMediaInputInputList : public ReadAttribute { public: - ReadPumpConfigurationAndControlMinConstFlow() - : ReadAttribute("min-const-flow") + ReadMediaInputInputList() + : ReadAttribute("input-list") { } - ~ReadPumpConfigurationAndControlMinConstFlow() {} + ~ReadMediaInputInputList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); + [cluster readAttributeInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.InputList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MinConstFlow read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput InputList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48010,37 +51370,34 @@ class ReadPumpConfigurationAndControlMinConstFlow : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMinConstFlow : public SubscribeAttribute { +class SubscribeAttributeMediaInputInputList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMinConstFlow() - : SubscribeAttribute("min-const-flow") + SubscribeAttributeMediaInputInputList() + : SubscribeAttribute("input-list") { } - ~SubscribeAttributePumpConfigurationAndControlMinConstFlow() {} + ~SubscribeAttributeMediaInputInputList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMinConstFlowWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeInputListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.InputList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48052,32 +51409,30 @@ class SubscribeAttributePumpConfigurationAndControlMinConstFlow : public Subscri }; /* - * Attribute MaxConstFlow + * Attribute CurrentInput */ -class ReadPumpConfigurationAndControlMaxConstFlow : public ReadAttribute { +class ReadMediaInputCurrentInput : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxConstFlow() - : ReadAttribute("max-const-flow") + ReadMediaInputCurrentInput() + : ReadAttribute("current-input") { } - ~ReadPumpConfigurationAndControlMaxConstFlow() {} + ~ReadMediaInputCurrentInput() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); + [cluster readAttributeCurrentInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.CurrentInput response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstFlow read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput CurrentInput read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48085,74 +51440,69 @@ class ReadPumpConfigurationAndControlMaxConstFlow : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxConstFlow : public SubscribeAttribute { +class SubscribeAttributeMediaInputCurrentInput : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxConstFlow() - : SubscribeAttribute("max-const-flow") + SubscribeAttributeMediaInputCurrentInput() + : SubscribeAttribute("current-input") { } - ~SubscribeAttributePumpConfigurationAndControlMaxConstFlow() {} + ~SubscribeAttributeMediaInputCurrentInput() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMaxConstFlowWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override + [cluster subscribeAttributeCurrentInputWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.CurrentInput response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } }; /* - * Attribute MinConstTemp + * Attribute GeneratedCommandList */ -class ReadPumpConfigurationAndControlMinConstTemp : public ReadAttribute { +class ReadMediaInputGeneratedCommandList : public ReadAttribute { public: - ReadPumpConfigurationAndControlMinConstTemp() - : ReadAttribute("min-const-temp") + ReadMediaInputGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadPumpConfigurationAndControlMinConstTemp() {} + ~ReadMediaInputGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MinConstTemp read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48160,37 +51510,35 @@ class ReadPumpConfigurationAndControlMinConstTemp : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMinConstTemp : public SubscribeAttribute { +class SubscribeAttributeMediaInputGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMinConstTemp() - : SubscribeAttribute("min-const-temp") + SubscribeAttributeMediaInputGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePumpConfigurationAndControlMinConstTemp() {} + ~SubscribeAttributeMediaInputGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeMinConstTempWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48202,32 +51550,30 @@ class SubscribeAttributePumpConfigurationAndControlMinConstTemp : public Subscri }; /* - * Attribute MaxConstTemp + * Attribute AcceptedCommandList */ -class ReadPumpConfigurationAndControlMaxConstTemp : public ReadAttribute { +class ReadMediaInputAcceptedCommandList : public ReadAttribute { public: - ReadPumpConfigurationAndControlMaxConstTemp() - : ReadAttribute("max-const-temp") + ReadMediaInputAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadPumpConfigurationAndControlMaxConstTemp() {} + ~ReadMediaInputAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstTemp read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48235,37 +51581,35 @@ class ReadPumpConfigurationAndControlMaxConstTemp : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlMaxConstTemp : public SubscribeAttribute { +class SubscribeAttributeMediaInputAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlMaxConstTemp() - : SubscribeAttribute("max-const-temp") + SubscribeAttributeMediaInputAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePumpConfigurationAndControlMaxConstTemp() {} + ~SubscribeAttributeMediaInputAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeMaxConstTempWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48277,32 +51621,30 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstTemp : public Subscri }; /* - * Attribute PumpStatus + * Attribute AttributeList */ -class ReadPumpConfigurationAndControlPumpStatus : public ReadAttribute { +class ReadMediaInputAttributeList : public ReadAttribute { public: - ReadPumpConfigurationAndControlPumpStatus() - : ReadAttribute("pump-status") + ReadMediaInputAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadPumpConfigurationAndControlPumpStatus() {} + ~ReadMediaInputAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl PumpStatus read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48310,37 +51652,34 @@ class ReadPumpConfigurationAndControlPumpStatus : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlPumpStatus : public SubscribeAttribute { +class SubscribeAttributeMediaInputAttributeList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlPumpStatus() - : SubscribeAttribute("pump-status") + SubscribeAttributeMediaInputAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePumpConfigurationAndControlPumpStatus() {} + ~SubscribeAttributeMediaInputAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributePumpStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48352,32 +51691,30 @@ class SubscribeAttributePumpConfigurationAndControlPumpStatus : public Subscribe }; /* - * Attribute EffectiveOperationMode + * Attribute FeatureMap */ -class ReadPumpConfigurationAndControlEffectiveOperationMode : public ReadAttribute { +class ReadMediaInputFeatureMap : public ReadAttribute { public: - ReadPumpConfigurationAndControlEffectiveOperationMode() - : ReadAttribute("effective-operation-mode") + ReadMediaInputFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadPumpConfigurationAndControlEffectiveOperationMode() {} + ~ReadMediaInputFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl EffectiveOperationMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48385,38 +51722,34 @@ class ReadPumpConfigurationAndControlEffectiveOperationMode : public ReadAttribu } }; -class SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode : public SubscribeAttribute { +class SubscribeAttributeMediaInputFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode() - : SubscribeAttribute("effective-operation-mode") + SubscribeAttributeMediaInputFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode() {} + ~SubscribeAttributeMediaInputFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeEffectiveOperationModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48428,32 +51761,30 @@ class SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode : publ }; /* - * Attribute EffectiveControlMode + * Attribute ClusterRevision */ -class ReadPumpConfigurationAndControlEffectiveControlMode : public ReadAttribute { +class ReadMediaInputClusterRevision : public ReadAttribute { public: - ReadPumpConfigurationAndControlEffectiveControlMode() - : ReadAttribute("effective-control-mode") + ReadMediaInputClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadPumpConfigurationAndControlEffectiveControlMode() {} + ~ReadMediaInputClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl EffectiveControlMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaInput ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48461,37 +51792,34 @@ class ReadPumpConfigurationAndControlEffectiveControlMode : public ReadAttribute } }; -class SubscribeAttributePumpConfigurationAndControlEffectiveControlMode : public SubscribeAttribute { +class SubscribeAttributeMediaInputClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlEffectiveControlMode() - : SubscribeAttribute("effective-control-mode") + SubscribeAttributeMediaInputClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePumpConfigurationAndControlEffectiveControlMode() {} + ~SubscribeAttributeMediaInputClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEffectiveControlModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaInput.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48502,299 +51830,582 @@ class SubscribeAttributePumpConfigurationAndControlEffectiveControlMode : public } }; +/*----------------------------------------------------------------------------*\ +| Cluster MediaPlayback | 0x0506 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Play | 0x00 | +| * Pause | 0x01 | +| * StopPlayback | 0x02 | +| * StartOver | 0x03 | +| * Previous | 0x04 | +| * Next | 0x05 | +| * Rewind | 0x06 | +| * FastForward | 0x07 | +| * SkipForward | 0x08 | +| * SkipBackward | 0x09 | +| * Seek | 0x0B | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentState | 0x0000 | +| * StartTime | 0x0001 | +| * Duration | 0x0002 | +| * SampledPosition | 0x0003 | +| * PlaybackSpeed | 0x0004 | +| * SeekRangeEnd | 0x0005 | +| * SeekRangeStart | 0x0006 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute Capacity + * Command Play */ -class ReadPumpConfigurationAndControlCapacity : public ReadAttribute { +class MediaPlaybackPlay : public ClusterCommand { public: - ReadPumpConfigurationAndControlCapacity() - : ReadAttribute("capacity") + MediaPlaybackPlay() + : ClusterCommand("play") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~ReadPumpConfigurationAndControlCapacity() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl Capacity read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterPlayParams 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 playWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaPlayback::Commands::Play::Type mRequest; }; -class SubscribeAttributePumpConfigurationAndControlCapacity : public SubscribeAttribute { +/* + * Command Pause + */ +class MediaPlaybackPause : public ClusterCommand { public: - SubscribeAttributePumpConfigurationAndControlCapacity() - : SubscribeAttribute("capacity") + MediaPlaybackPause() + : ClusterCommand("pause") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~SubscribeAttributePumpConfigurationAndControlCapacity() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000013) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCapacityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000001) on endpoint %u", endpointId); - return CHIP_NO_ERROR; + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterPauseParams 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 pauseWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::MediaPlayback::Commands::Pause::Type mRequest; }; /* - * Attribute Speed + * Command StopPlayback */ -class ReadPumpConfigurationAndControlSpeed : public ReadAttribute { +class MediaPlaybackStopPlayback : public ClusterCommand { public: - ReadPumpConfigurationAndControlSpeed() - : ReadAttribute("speed") + MediaPlaybackStopPlayback() + : ClusterCommand("stop-playback") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~ReadPumpConfigurationAndControlSpeed() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl Speed read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterStopPlaybackParams 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 stopPlaybackWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaPlayback::Commands::StopPlayback::Type mRequest; }; -class SubscribeAttributePumpConfigurationAndControlSpeed : public SubscribeAttribute { +/* + * Command StartOver + */ +class MediaPlaybackStartOver : public ClusterCommand { public: - SubscribeAttributePumpConfigurationAndControlSpeed() - : SubscribeAttribute("speed") + MediaPlaybackStartOver() + : ClusterCommand("start-over") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~SubscribeAttributePumpConfigurationAndControlSpeed() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterStartOverParams 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 startOverWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::MediaPlayback::Commands::StartOver::Type mRequest; +}; + +/* + * Command Previous + */ +class MediaPlaybackPrevious : public ClusterCommand { +public: + MediaPlaybackPrevious() + : ClusterCommand("previous") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterPreviousParams 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 previousWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaPlayback::Commands::Previous::Type mRequest; }; /* - * Attribute LifetimeRunningHours + * Command Next */ -class ReadPumpConfigurationAndControlLifetimeRunningHours : public ReadAttribute { +class MediaPlaybackNext : public ClusterCommand { public: - ReadPumpConfigurationAndControlLifetimeRunningHours() - : ReadAttribute("lifetime-running-hours") + MediaPlaybackNext() + : ClusterCommand("next") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~ReadPumpConfigurationAndControlLifetimeRunningHours() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl LifetimeRunningHours read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterNextParams 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 nextWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaPlayback::Commands::Next::Type mRequest; }; -class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribute { +/* + * Command Rewind + */ +class MediaPlaybackRewind : public ClusterCommand { public: - WritePumpConfigurationAndControlLifetimeRunningHours() - : WriteAttribute("lifetime-running-hours") + MediaPlaybackRewind() + : ClusterCommand("rewind") { - AddArgument("attr-name", "lifetime-running-hours"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - WriteAttribute::AddArguments(); + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~WritePumpConfigurationAndControlLifetimeRunningHours() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs + __auto_type * params = [[CHIPMediaPlaybackClusterRewindParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster rewindWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - [cluster writeAttributeLifetimeRunningHoursWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "PumpConfigurationAndControl LifetimeRunningHours write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; +private: + chip::app::Clusters::MediaPlayback::Commands::Rewind::Type mRequest; +}; + +/* + * Command FastForward + */ +class MediaPlaybackFastForward : public ClusterCommand { +public: + MediaPlaybackFastForward() + : ClusterCommand("fast-forward") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterFastForwardParams 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 fastForwardWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } return chipError; } private: - uint32_t mValue; + chip::app::Clusters::MediaPlayback::Commands::FastForward::Type mRequest; }; -class SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours : public SubscribeAttribute { +/* + * Command SkipForward + */ +class MediaPlaybackSkipForward : public ClusterCommand { public: - SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours() - : SubscribeAttribute("lifetime-running-hours") + MediaPlaybackSkipForward() + : ClusterCommand("skip-forward") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds); + ClusterCommand::AddArguments(); } - ~SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterSkipForwardParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:mDeltaPositionMilliseconds]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster skipForwardWithParams:params + completionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type mRequest; + uint64_t mDeltaPositionMilliseconds; +}; + +/* + * Command SkipBackward + */ +class MediaPlaybackSkipBackward : public ClusterCommand { +public: + MediaPlaybackSkipBackward() + : ClusterCommand("skip-backward") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds); + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLifetimeRunningHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterSkipBackwardParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:mDeltaPositionMilliseconds]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster skipBackwardWithParams:params + completionHandler:^( + CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type mRequest; + uint64_t mDeltaPositionMilliseconds; +}; + +/* + * Command Seek + */ +class MediaPlaybackSeek : public ClusterCommand { +public: + MediaPlaybackSeek() + : ClusterCommand("seek") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Position", 0, UINT64_MAX, &mPosition); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPMediaPlaybackClusterSeekParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.position = [NSNumber numberWithUnsignedLongLong:mPosition]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + seekWithParams:params + completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::MediaPlayback::Commands::Seek::Type mRequest; + uint64_t mPosition; }; /* - * Attribute Power + * Attribute CurrentState */ -class ReadPumpConfigurationAndControlPower : public ReadAttribute { +class ReadMediaPlaybackCurrentState : public ReadAttribute { public: - ReadPumpConfigurationAndControlPower() - : ReadAttribute("power") + ReadMediaPlaybackCurrentState() + : ReadAttribute("current-state") { } - ~ReadPumpConfigurationAndControlPower() {} + ~ReadMediaPlaybackCurrentState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); + [cluster readAttributeCurrentStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.CurrentState response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl Power read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback CurrentState read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48802,36 +52413,34 @@ class ReadPumpConfigurationAndControlPower : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlPower : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackCurrentState : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlPower() - : SubscribeAttribute("power") + SubscribeAttributeMediaPlaybackCurrentState() + : SubscribeAttribute("current-state") { } - ~SubscribeAttributePumpConfigurationAndControlPower() {} + ~SubscribeAttributeMediaPlaybackCurrentState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCurrentStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.CurrentState response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48843,32 +52452,30 @@ class SubscribeAttributePumpConfigurationAndControlPower : public SubscribeAttri }; /* - * Attribute LifetimeEnergyConsumed + * Attribute StartTime */ -class ReadPumpConfigurationAndControlLifetimeEnergyConsumed : public ReadAttribute { +class ReadMediaPlaybackStartTime : public ReadAttribute { public: - ReadPumpConfigurationAndControlLifetimeEnergyConsumed() - : ReadAttribute("lifetime-energy-consumed") + ReadMediaPlaybackStartTime() + : ReadAttribute("start-time") { } - ~ReadPumpConfigurationAndControlLifetimeEnergyConsumed() {} + ~ReadMediaPlaybackStartTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", [value description]); + [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.StartTime response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl LifetimeEnergyConsumed read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback StartTime read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48876,81 +52483,104 @@ class ReadPumpConfigurationAndControlLifetimeEnergyConsumed : public ReadAttribu } }; -class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttribute { +class SubscribeAttributeMediaPlaybackStartTime : public SubscribeAttribute { public: - WritePumpConfigurationAndControlLifetimeEnergyConsumed() - : WriteAttribute("lifetime-energy-consumed") + SubscribeAttributeMediaPlaybackStartTime() + : SubscribeAttribute("start-time") { - AddArgument("attr-name", "lifetime-energy-consumed"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - WriteAttribute::AddArguments(); } - ~WritePumpConfigurationAndControlLifetimeEnergyConsumed() {} + ~SubscribeAttributeMediaPlaybackStartTime() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeStartTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.StartTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeLifetimeEnergyConsumedWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "PumpConfigurationAndControl LifetimeEnergyConsumed write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - uint32_t mValue; -}; - -class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : public SubscribeAttribute { + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Duration + */ +class ReadMediaPlaybackDuration : public ReadAttribute { public: - SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed() - : SubscribeAttribute("lifetime-energy-consumed") + ReadMediaPlaybackDuration() + : ReadAttribute("duration") { } - ~SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed() {} + ~ReadMediaPlaybackDuration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.Duration response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "MediaPlayback Duration read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeMediaPlaybackDuration : public SubscribeAttribute { +public: + SubscribeAttributeMediaPlaybackDuration() + : SubscribeAttribute("duration") + { + } + + ~SubscribeAttributeMediaPlaybackDuration() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeLifetimeEnergyConsumedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDurationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.Duration response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -48962,32 +52592,31 @@ class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : publ }; /* - * Attribute OperationMode + * Attribute SampledPosition */ -class ReadPumpConfigurationAndControlOperationMode : public ReadAttribute { +class ReadMediaPlaybackSampledPosition : public ReadAttribute { public: - ReadPumpConfigurationAndControlOperationMode() - : ReadAttribute("operation-mode") + ReadMediaPlaybackSampledPosition() + : ReadAttribute("sampled-position") { } - ~ReadPumpConfigurationAndControlOperationMode() {} + ~ReadMediaPlaybackSampledPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.OperationMode response %@", [value description]); + [cluster readAttributeSampledPositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl OperationMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback SampledPosition read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -48995,75 +52624,101 @@ class ReadPumpConfigurationAndControlOperationMode : public ReadAttribute { } }; -class WritePumpConfigurationAndControlOperationMode : public WriteAttribute { +class SubscribeAttributeMediaPlaybackSampledPosition : public SubscribeAttribute { public: - WritePumpConfigurationAndControlOperationMode() - : WriteAttribute("operation-mode") + SubscribeAttributeMediaPlaybackSampledPosition() + : SubscribeAttribute("sampled-position") { - AddArgument("attr-name", "operation-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); } - ~WritePumpConfigurationAndControlOperationMode() {} + ~SubscribeAttributeMediaPlaybackSampledPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSampledPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, + NSError * _Nullable error) { + NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; - [cluster writeAttributeOperationModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl OperationMode write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + return CHIP_NO_ERROR; } -private: - uint8_t mValue; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; -class SubscribeAttributePumpConfigurationAndControlOperationMode : public SubscribeAttribute { +/* + * Attribute PlaybackSpeed + */ +class ReadMediaPlaybackPlaybackSpeed : public ReadAttribute { public: - SubscribeAttributePumpConfigurationAndControlOperationMode() - : SubscribeAttribute("operation-mode") + ReadMediaPlaybackPlaybackSpeed() + : ReadAttribute("playback-speed") { } - ~SubscribeAttributePumpConfigurationAndControlOperationMode() {} + ~ReadMediaPlaybackPlaybackSpeed() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "MediaPlayback PlaybackSpeed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeMediaPlaybackPlaybackSpeed : public SubscribeAttribute { +public: + SubscribeAttributeMediaPlaybackPlaybackSpeed() + : SubscribeAttribute("playback-speed") + { + } + + ~SubscribeAttributeMediaPlaybackPlaybackSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOperationModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributePlaybackSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.OperationMode response %@", - [value description]); + NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -49079,32 +52734,30 @@ class SubscribeAttributePumpConfigurationAndControlOperationMode : public Subscr }; /* - * Attribute ControlMode + * Attribute SeekRangeEnd */ -class ReadPumpConfigurationAndControlControlMode : public ReadAttribute { +class ReadMediaPlaybackSeekRangeEnd : public ReadAttribute { public: - ReadPumpConfigurationAndControlControlMode() - : ReadAttribute("control-mode") + ReadMediaPlaybackSeekRangeEnd() + : ReadAttribute("seek-range-end") { } - ~ReadPumpConfigurationAndControlControlMode() {} + ~ReadMediaPlaybackSeekRangeEnd() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); + [cluster readAttributeSeekRangeEndWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl ControlMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback SeekRangeEnd read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49112,79 +52765,34 @@ class ReadPumpConfigurationAndControlControlMode : public ReadAttribute { } }; -class WritePumpConfigurationAndControlControlMode : public WriteAttribute { -public: - WritePumpConfigurationAndControlControlMode() - : WriteAttribute("control-mode") - { - AddArgument("attr-name", "control-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WritePumpConfigurationAndControlControlMode() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000021) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeControlModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl ControlMode write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributePumpConfigurationAndControlControlMode : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackSeekRangeEnd : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlControlMode() - : SubscribeAttribute("control-mode") + SubscribeAttributeMediaPlaybackSeekRangeEnd() + : SubscribeAttribute("seek-range-end") { } - ~SubscribeAttributePumpConfigurationAndControlControlMode() {} + ~SubscribeAttributeMediaPlaybackSeekRangeEnd() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeControlModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSeekRangeEndWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49196,32 +52804,30 @@ class SubscribeAttributePumpConfigurationAndControlControlMode : public Subscrib }; /* - * Attribute AlarmMask + * Attribute SeekRangeStart */ -class ReadPumpConfigurationAndControlAlarmMask : public ReadAttribute { +class ReadMediaPlaybackSeekRangeStart : public ReadAttribute { public: - ReadPumpConfigurationAndControlAlarmMask() - : ReadAttribute("alarm-mask") + ReadMediaPlaybackSeekRangeStart() + : ReadAttribute("seek-range-start") { } - ~ReadPumpConfigurationAndControlAlarmMask() {} + ~ReadMediaPlaybackSeekRangeStart() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAlarmMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.AlarmMask response %@", [value description]); + [cluster readAttributeSeekRangeStartWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl AlarmMask read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback SeekRangeStart read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49229,36 +52835,34 @@ class ReadPumpConfigurationAndControlAlarmMask : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlAlarmMask : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackSeekRangeStart : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlAlarmMask() - : SubscribeAttribute("alarm-mask") + SubscribeAttributeMediaPlaybackSeekRangeStart() + : SubscribeAttribute("seek-range-start") { } - ~SubscribeAttributePumpConfigurationAndControlAlarmMask() {} + ~SubscribeAttributeMediaPlaybackSeekRangeStart() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAlarmMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.AlarmMask response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSeekRangeStartWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49272,30 +52876,28 @@ class SubscribeAttributePumpConfigurationAndControlAlarmMask : public SubscribeA /* * Attribute GeneratedCommandList */ -class ReadPumpConfigurationAndControlGeneratedCommandList : public ReadAttribute { +class ReadMediaPlaybackGeneratedCommandList : public ReadAttribute { public: - ReadPumpConfigurationAndControlGeneratedCommandList() + ReadMediaPlaybackGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadPumpConfigurationAndControlGeneratedCommandList() {} + ~ReadMediaPlaybackGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", [value description]); + NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49303,22 +52905,20 @@ class ReadPumpConfigurationAndControlGeneratedCommandList : public ReadAttribute } }; -class SubscribeAttributePumpConfigurationAndControlGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlGeneratedCommandList() + SubscribeAttributeMediaPlaybackGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributePumpConfigurationAndControlGeneratedCommandList() {} + ~SubscribeAttributeMediaPlaybackGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -49328,7 +52928,7 @@ class SubscribeAttributePumpConfigurationAndControlGeneratedCommandList : public params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", + NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -49347,30 +52947,28 @@ class SubscribeAttributePumpConfigurationAndControlGeneratedCommandList : public /* * Attribute AcceptedCommandList */ -class ReadPumpConfigurationAndControlAcceptedCommandList : public ReadAttribute { +class ReadMediaPlaybackAcceptedCommandList : public ReadAttribute { public: - ReadPumpConfigurationAndControlAcceptedCommandList() + ReadMediaPlaybackAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadPumpConfigurationAndControlAcceptedCommandList() {} + ~ReadMediaPlaybackAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", [value description]); + NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49378,37 +52976,35 @@ class ReadPumpConfigurationAndControlAcceptedCommandList : public ReadAttribute } }; -class SubscribeAttributePumpConfigurationAndControlAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlAcceptedCommandList() + SubscribeAttributeMediaPlaybackAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributePumpConfigurationAndControlAcceptedCommandList() {} + ~SubscribeAttributeMediaPlaybackAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49422,30 +53018,28 @@ class SubscribeAttributePumpConfigurationAndControlAcceptedCommandList : public /* * Attribute AttributeList */ -class ReadPumpConfigurationAndControlAttributeList : public ReadAttribute { +class ReadMediaPlaybackAttributeList : public ReadAttribute { public: - ReadPumpConfigurationAndControlAttributeList() + ReadMediaPlaybackAttributeList() : ReadAttribute("attribute-list") { } - ~ReadPumpConfigurationAndControlAttributeList() {} + ~ReadMediaPlaybackAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.AttributeList response %@", [value description]); + NSLog(@"MediaPlayback.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49453,22 +53047,20 @@ class ReadPumpConfigurationAndControlAttributeList : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlAttributeList : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackAttributeList : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlAttributeList() + SubscribeAttributeMediaPlaybackAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributePumpConfigurationAndControlAttributeList() {} + ~SubscribeAttributeMediaPlaybackAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -49478,8 +53070,7 @@ class SubscribeAttributePumpConfigurationAndControlAttributeList : public Subscr params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.AttributeList response %@", - [value description]); + NSLog(@"MediaPlayback.AttributeList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -49497,30 +53088,28 @@ class SubscribeAttributePumpConfigurationAndControlAttributeList : public Subscr /* * Attribute FeatureMap */ -class ReadPumpConfigurationAndControlFeatureMap : public ReadAttribute { +class ReadMediaPlaybackFeatureMap : public ReadAttribute { public: - ReadPumpConfigurationAndControlFeatureMap() + ReadMediaPlaybackFeatureMap() : ReadAttribute("feature-map") { } - ~ReadPumpConfigurationAndControlFeatureMap() {} + ~ReadMediaPlaybackFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); + NSLog(@"MediaPlayback.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49528,37 +53117,34 @@ class ReadPumpConfigurationAndControlFeatureMap : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlFeatureMap : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackFeatureMap : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlFeatureMap() + SubscribeAttributeMediaPlaybackFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributePumpConfigurationAndControlFeatureMap() {} + ~SubscribeAttributeMediaPlaybackFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MediaPlayback.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49572,30 +53158,28 @@ class SubscribeAttributePumpConfigurationAndControlFeatureMap : public Subscribe /* * Attribute ClusterRevision */ -class ReadPumpConfigurationAndControlClusterRevision : public ReadAttribute { +class ReadMediaPlaybackClusterRevision : public ReadAttribute { public: - ReadPumpConfigurationAndControlClusterRevision() + ReadMediaPlaybackClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadPumpConfigurationAndControlClusterRevision() {} + ~ReadMediaPlaybackClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", [value description]); + NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PumpConfigurationAndControl ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "MediaPlayback ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49603,22 +53187,20 @@ class ReadPumpConfigurationAndControlClusterRevision : public ReadAttribute { } }; -class SubscribeAttributePumpConfigurationAndControlClusterRevision : public SubscribeAttribute { +class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute { public: - SubscribeAttributePumpConfigurationAndControlClusterRevision() + SubscribeAttributeMediaPlaybackClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributePumpConfigurationAndControlClusterRevision() {} + ~SubscribeAttributeMediaPlaybackClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -49628,8 +53210,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", - [value description]); + NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -49645,15 +53226,18 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs }; /*----------------------------------------------------------------------------*\ -| Cluster RelativeHumidityMeasurement | 0x0405 | +| Cluster ModeSelect | 0x0050 | |------------------------------------------------------------------------------| | Commands: | | +| * ChangeToMode | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | +| * Description | 0x0000 | +| * StandardNamespace | 0x0001 | +| * SupportedModes | 0x0002 | +| * CurrentMode | 0x0003 | +| * StartUpMode | 0x0004 | +| * OnMode | 0x0005 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -49664,32 +53248,78 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs \*----------------------------------------------------------------------------*/ /* - * Attribute MeasuredValue + * Command ChangeToMode */ -class ReadRelativeHumidityMeasurementMeasuredValue : public ReadAttribute { +class ModeSelectChangeToMode : public ClusterCommand { public: - ReadRelativeHumidityMeasurementMeasuredValue() - : ReadAttribute("measured-value") + ModeSelectChangeToMode() + : ClusterCommand("change-to-mode") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NewMode", 0, UINT8_MAX, &mNewMode); + ClusterCommand::AddArguments(); } - ~ReadRelativeHumidityMeasurementMeasuredValue() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.newMode = [NSNumber numberWithUnsignedChar:mNewMode]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster changeToModeWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; + uint8_t mNewMode; +}; + +/* + * Attribute Description + */ +class ReadModeSelectDescription : public ReadAttribute { +public: + ReadModeSelectDescription() + : ReadAttribute("description") + { + } + + ~ReadModeSelectDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", [value description]); + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.Description response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect Description read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49697,37 +53327,34 @@ class ReadRelativeHumidityMeasurementMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeRelativeHumidityMeasurementMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeModeSelectDescription : public SubscribeAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementMeasuredValue() - : SubscribeAttribute("measured-value") + SubscribeAttributeModeSelectDescription() + : SubscribeAttribute("description") { } - ~SubscribeAttributeRelativeHumidityMeasurementMeasuredValue() {} + ~SubscribeAttributeModeSelectDescription() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.Description response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49739,32 +53366,30 @@ class SubscribeAttributeRelativeHumidityMeasurementMeasuredValue : public Subscr }; /* - * Attribute MinMeasuredValue + * Attribute StandardNamespace */ -class ReadRelativeHumidityMeasurementMinMeasuredValue : public ReadAttribute { +class ReadModeSelectStandardNamespace : public ReadAttribute { public: - ReadRelativeHumidityMeasurementMinMeasuredValue() - : ReadAttribute("min-measured-value") + ReadModeSelectStandardNamespace() + : ReadAttribute("standard-namespace") { } - ~ReadRelativeHumidityMeasurementMinMeasuredValue() {} + ~ReadModeSelectStandardNamespace() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", [value description]); + [cluster readAttributeStandardNamespaceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect StandardNamespace read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49772,37 +53397,34 @@ class ReadRelativeHumidityMeasurementMinMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeModeSelectStandardNamespace : public SubscribeAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue() - : SubscribeAttribute("min-measured-value") + SubscribeAttributeModeSelectStandardNamespace() + : SubscribeAttribute("standard-namespace") { } - ~SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue() {} + ~SubscribeAttributeModeSelectStandardNamespace() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeStandardNamespaceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49814,32 +53436,30 @@ class SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue : public Sub }; /* - * Attribute MaxMeasuredValue + * Attribute SupportedModes */ -class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ReadAttribute { +class ReadModeSelectSupportedModes : public ReadAttribute { public: - ReadRelativeHumidityMeasurementMaxMeasuredValue() - : ReadAttribute("max-measured-value") + ReadModeSelectSupportedModes() + : ReadAttribute("supported-modes") { } - ~ReadRelativeHumidityMeasurementMaxMeasuredValue() {} + ~ReadModeSelectSupportedModes() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", [value description]); + [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.SupportedModes response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect SupportedModes read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49847,37 +53467,34 @@ class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue : public SubscribeAttribute { +class SubscribeAttributeModeSelectSupportedModes : public SubscribeAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue() - : SubscribeAttribute("max-measured-value") + SubscribeAttributeModeSelectSupportedModes() + : SubscribeAttribute("supported-modes") { } - ~SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue() {} + ~SubscribeAttributeModeSelectSupportedModes() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSupportedModesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.SupportedModes response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49889,32 +53506,30 @@ class SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue : public Sub }; /* - * Attribute Tolerance + * Attribute CurrentMode */ -class ReadRelativeHumidityMeasurementTolerance : public ReadAttribute { +class ReadModeSelectCurrentMode : public ReadAttribute { public: - ReadRelativeHumidityMeasurementTolerance() - : ReadAttribute("tolerance") + ReadModeSelectCurrentMode() + : ReadAttribute("current-mode") { } - ~ReadRelativeHumidityMeasurementTolerance() {} + ~ReadModeSelectCurrentMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); + [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.CurrentMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect CurrentMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49922,36 +53537,34 @@ class ReadRelativeHumidityMeasurementTolerance : public ReadAttribute { } }; -class SubscribeAttributeRelativeHumidityMeasurementTolerance : public SubscribeAttribute { +class SubscribeAttributeModeSelectCurrentMode : public SubscribeAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementTolerance() - : SubscribeAttribute("tolerance") + SubscribeAttributeModeSelectCurrentMode() + : SubscribeAttribute("current-mode") { } - ~SubscribeAttributeRelativeHumidityMeasurementTolerance() {} + ~SubscribeAttributeModeSelectCurrentMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCurrentModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -49963,32 +53576,30 @@ class SubscribeAttributeRelativeHumidityMeasurementTolerance : public SubscribeA }; /* - * Attribute GeneratedCommandList + * Attribute StartUpMode */ -class ReadRelativeHumidityMeasurementGeneratedCommandList : public ReadAttribute { +class ReadModeSelectStartUpMode : public ReadAttribute { public: - ReadRelativeHumidityMeasurementGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadModeSelectStartUpMode() + : ReadAttribute("start-up-mode") { } - ~ReadRelativeHumidityMeasurementGeneratedCommandList() {} + ~ReadModeSelectStartUpMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", [value description]); + [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.StartUpMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect StartUpMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -49996,37 +53607,74 @@ class ReadRelativeHumidityMeasurementGeneratedCommandList : public ReadAttribute } }; -class SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList : public SubscribeAttribute { +class WriteModeSelectStartUpMode : public WriteAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteModeSelectStartUpMode() + : WriteAttribute("start-up-mode") { + AddArgument("attr-name", "start-up-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList() {} + ~WriteModeSelectStartUpMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributeStartUpModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "ModeSelect StartUpMode write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { +public: + SubscribeAttributeModeSelectStartUpMode() + : SubscribeAttribute("start-up-mode") + { + } + + ~SubscribeAttributeModeSelectStartUpMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeStartUpModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.StartUpMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -50038,32 +53686,30 @@ class SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList : public }; /* - * Attribute AcceptedCommandList + * Attribute OnMode */ -class ReadRelativeHumidityMeasurementAcceptedCommandList : public ReadAttribute { +class ReadModeSelectOnMode : public ReadAttribute { public: - ReadRelativeHumidityMeasurementAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadModeSelectOnMode() + : ReadAttribute("on-mode") { } - ~ReadRelativeHumidityMeasurementAcceptedCommandList() {} + ~ReadModeSelectOnMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", [value description]); + [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.OnMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect OnMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50071,37 +53717,73 @@ class ReadRelativeHumidityMeasurementAcceptedCommandList : public ReadAttribute } }; -class SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList : public SubscribeAttribute { +class WriteModeSelectOnMode : public WriteAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteModeSelectOnMode() + : WriteAttribute("on-mode") { + AddArgument("attr-name", "on-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList() {} + ~WriteModeSelectOnMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeOnModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "ModeSelect OnMode write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { +public: + SubscribeAttributeModeSelectOnMode() + : SubscribeAttribute("on-mode") + { + } + + ~SubscribeAttributeModeSelectOnMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOnModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.OnMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -50113,32 +53795,172 @@ class SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList : public }; /* - * Attribute AttributeList + * Attribute GeneratedCommandList */ -class ReadRelativeHumidityMeasurementAttributeList : public ReadAttribute { +class ReadModeSelectGeneratedCommandList : public ReadAttribute { public: - ReadRelativeHumidityMeasurementAttributeList() - : ReadAttribute("attribute-list") - { + ReadModeSelectGeneratedCommandList() + : ReadAttribute("generated-command-list") + { } - ~ReadRelativeHumidityMeasurementAttributeList() {} + ~ReadModeSelectGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ModeSelect GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeModeSelectGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeModeSelectGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeModeSelectGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadModeSelectAcceptedCommandList : public ReadAttribute { +public: + ReadModeSelectAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadModeSelectAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ModeSelect AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeModeSelectAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeModeSelectAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeModeSelectAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadModeSelectAttributeList : public ReadAttribute { +public: + ReadModeSelectAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadModeSelectAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", [value description]); + NSLog(@"ModeSelect.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50146,22 +53968,20 @@ class ReadRelativeHumidityMeasurementAttributeList : public ReadAttribute { } }; -class SubscribeAttributeRelativeHumidityMeasurementAttributeList : public SubscribeAttribute { +class SubscribeAttributeModeSelectAttributeList : public SubscribeAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementAttributeList() + SubscribeAttributeModeSelectAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeRelativeHumidityMeasurementAttributeList() {} + ~SubscribeAttributeModeSelectAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -50171,8 +53991,7 @@ class SubscribeAttributeRelativeHumidityMeasurementAttributeList : public Subscr params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", - [value description]); + NSLog(@"ModeSelect.AttributeList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -50187,33 +54006,101 @@ class SubscribeAttributeRelativeHumidityMeasurementAttributeList : public Subscr } }; +/* + * Attribute FeatureMap + */ +class ReadModeSelectFeatureMap : public ReadAttribute { +public: + ReadModeSelectFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadModeSelectFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ModeSelect FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeModeSelectFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeModeSelectFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeModeSelectFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ -class ReadRelativeHumidityMeasurementClusterRevision : public ReadAttribute { +class ReadModeSelectClusterRevision : public ReadAttribute { public: - ReadRelativeHumidityMeasurementClusterRevision() + ReadModeSelectClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadRelativeHumidityMeasurementClusterRevision() {} + ~ReadModeSelectClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", [value description]); + NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "RelativeHumidityMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "ModeSelect ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50221,22 +54108,20 @@ class ReadRelativeHumidityMeasurementClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public SubscribeAttribute { +class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeRelativeHumidityMeasurementClusterRevision() + SubscribeAttributeModeSelectClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeRelativeHumidityMeasurementClusterRevision() {} + ~SubscribeAttributeModeSelectClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -50246,8 +54131,7 @@ class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public Subs params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", - [value description]); + NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -50263,27 +54147,25 @@ class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public Subs }; /*----------------------------------------------------------------------------*\ -| Cluster Scenes | 0x0005 | +| Cluster NetworkCommissioning | 0x0031 | |------------------------------------------------------------------------------| | Commands: | | -| * AddScene | 0x00 | -| * ViewScene | 0x01 | -| * RemoveScene | 0x02 | -| * RemoveAllScenes | 0x03 | -| * StoreScene | 0x04 | -| * RecallScene | 0x05 | -| * GetSceneMembership | 0x06 | -| * EnhancedAddScene | 0x40 | -| * EnhancedViewScene | 0x41 | -| * CopyScene | 0x42 | +| * ScanNetworks | 0x00 | +| * AddOrUpdateWiFiNetwork | 0x02 | +| * AddOrUpdateThreadNetwork | 0x03 | +| * RemoveNetwork | 0x04 | +| * ConnectNetwork | 0x06 | +| * ReorderNetwork | 0x08 | |------------------------------------------------------------------------------| | Attributes: | | -| * SceneCount | 0x0000 | -| * CurrentScene | 0x0001 | -| * CurrentGroup | 0x0002 | -| * SceneValid | 0x0003 | -| * NameSupport | 0x0004 | -| * LastConfiguredBy | 0x0005 | +| * MaxNetworks | 0x0000 | +| * Networks | 0x0001 | +| * ScanMaxTimeSeconds | 0x0002 | +| * ConnectMaxTimeSeconds | 0x0003 | +| * InterfaceEnabled | 0x0004 | +| * LastNetworkingStatus | 0x0005 | +| * LastNetworkID | 0x0006 | +| * LastConnectErrorValue | 0x0007 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -50294,405 +54176,384 @@ class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public Subs \*----------------------------------------------------------------------------*/ /* - * Command AddScene + * Command ScanNetworks */ -class ScenesAddScene : public ClusterCommand { +class NetworkCommissioningScanNetworks : public ClusterCommand { public: - ScenesAddScene() - : ClusterCommand("add-scene") - , mComplex_ExtensionFieldSets(&mRequest.extensionFieldSets) + NetworkCommissioningScanNetworks() + : ClusterCommand("scan-networks") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); - AddArgument("SceneName", &mSceneName); - AddArgument("ExtensionFieldSets", &mComplex_ExtensionFieldSets); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Ssid", &mSsid); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterAddSceneParams alloc] init]; + __auto_type * params = [[CHIPNetworkCommissioningClusterScanNetworksParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; - params.sceneName = [[NSString alloc] initWithBytes:mSceneName.data() - length:mSceneName.size() - encoding:NSUTF8StringEncoding]; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.extensionFieldSets) { - CHIPScenesClusterSceneExtensionFieldSet * newElement_0; - newElement_0 = [CHIPScenesClusterSceneExtensionFieldSet new]; - newElement_0.clusterId = [NSNumber numberWithUnsignedInt:entry_0.clusterId]; - newElement_0.length = [NSNumber numberWithUnsignedChar:entry_0.length]; - newElement_0.value = [NSNumber numberWithUnsignedChar:entry_0.value]; - [array_0 addObject:newElement_0]; - } - params.extensionFieldSets = array_0; + if (mSsid.HasValue()) { + params.ssid = [[NSData alloc] initWithBytes:mSsid.Value().data() length:mSsid.Value().size()]; + } + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster addSceneWithParams:params - completionHandler:^(CHIPScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster scanNetworksWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mGroupId; - uint8_t mSceneId; - uint16_t mTransitionTime; - chip::ByteSpan mSceneName; - chip::app::Clusters::Scenes::Commands::AddScene::Type mRequest; - TypedComplexArgument> - mComplex_ExtensionFieldSets; + chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type mRequest; + chip::Optional mSsid; + chip::Optional mBreadcrumb; }; /* - * Command GetSceneMembership + * Command AddOrUpdateWiFiNetwork */ -class ScenesGetSceneMembership : public ClusterCommand { +class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { public: - ScenesGetSceneMembership() - : ClusterCommand("get-scene-membership") + NetworkCommissioningAddOrUpdateWiFiNetwork() + : ClusterCommand("add-or-update-wi-fi-network") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Ssid", &mSsid); + AddArgument("Credentials", &mCredentials); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterGetSceneMembershipParams alloc] init]; + __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; + params.credentials = [[NSData alloc] initWithBytes:mCredentials.data() length:mCredentials.size()]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getSceneMembershipWithParams:params - completionHandler:^(CHIPScenesClusterGetSceneMembershipResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + addOrUpdateWiFiNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mGroupId; + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type mRequest; + chip::ByteSpan mSsid; + chip::ByteSpan mCredentials; + chip::Optional mBreadcrumb; }; /* - * Command RecallScene + * Command AddOrUpdateThreadNetwork */ -class ScenesRecallScene : public ClusterCommand { +class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { public: - ScenesRecallScene() - : ClusterCommand("recall-scene") + NetworkCommissioningAddOrUpdateThreadNetwork() + : ClusterCommand("add-or-update-thread-network") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); - AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OperationalDataset", &mOperationalDataset); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterRecallSceneParams alloc] init]; + __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; - params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.operationalDataset = [[NSData alloc] initWithBytes:mOperationalDataset.data() length:mOperationalDataset.size()]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster recallSceneWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + addOrUpdateThreadNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mGroupId; - uint8_t mSceneId; - uint16_t mTransitionTime; + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type mRequest; + chip::ByteSpan mOperationalDataset; + chip::Optional mBreadcrumb; }; /* - * Command RemoveAllScenes + * Command RemoveNetwork */ -class ScenesRemoveAllScenes : public ClusterCommand { +class NetworkCommissioningRemoveNetwork : public ClusterCommand { public: - ScenesRemoveAllScenes() - : ClusterCommand("remove-all-scenes") + NetworkCommissioningRemoveNetwork() + : ClusterCommand("remove-network") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NetworkID", &mNetworkID); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterRemoveAllScenesParams alloc] init]; + __auto_type * params = [[CHIPNetworkCommissioningClusterRemoveNetworkParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster removeAllScenesWithParams:params - completionHandler:^( - CHIPScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; } - return chipError; - } - -private: - uint16_t mGroupId; -}; - -/* - * Command RemoveScene - */ -class ScenesRemoveScene : public ClusterCommand { -public: - ScenesRemoveScene() - : ClusterCommand("remove-scene") - { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterRemoveSceneParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster - removeSceneWithParams:params - completionHandler:^(CHIPScenesClusterRemoveSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster removeNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mGroupId; - uint8_t mSceneId; + chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type mRequest; + chip::ByteSpan mNetworkID; + chip::Optional mBreadcrumb; }; /* - * Command StoreScene + * Command ConnectNetwork */ -class ScenesStoreScene : public ClusterCommand { +class NetworkCommissioningConnectNetwork : public ClusterCommand { public: - ScenesStoreScene() - : ClusterCommand("store-scene") + NetworkCommissioningConnectNetwork() + : ClusterCommand("connect-network") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NetworkID", &mNetworkID); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterStoreSceneParams alloc] init]; + __auto_type * params = [[CHIPNetworkCommissioningClusterConnectNetworkParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster - storeSceneWithParams:params - completionHandler:^(CHIPScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster connectNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mGroupId; - uint8_t mSceneId; + chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Type mRequest; + chip::ByteSpan mNetworkID; + chip::Optional mBreadcrumb; }; /* - * Command ViewScene + * Command ReorderNetwork */ -class ScenesViewScene : public ClusterCommand { +class NetworkCommissioningReorderNetwork : public ClusterCommand { public: - ScenesViewScene() - : ClusterCommand("view-scene") + NetworkCommissioningReorderNetwork() + : ClusterCommand("reorder-network") { - AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); - AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NetworkID", &mNetworkID); + AddArgument("NetworkIndex", 0, UINT8_MAX, &mNetworkIndex); + AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPScenesClusterViewSceneParams alloc] init]; + __auto_type * params = [[CHIPNetworkCommissioningClusterReorderNetworkParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; - params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; + params.networkIndex = [NSNumber numberWithUnsignedChar:mNetworkIndex]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster viewSceneWithParams:params - completionHandler:^(CHIPScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster reorderNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint16_t mGroupId; - uint8_t mSceneId; + chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Type mRequest; + chip::ByteSpan mNetworkID; + uint8_t mNetworkIndex; + chip::Optional mBreadcrumb; }; /* - * Attribute SceneCount + * Attribute MaxNetworks */ -class ReadScenesSceneCount : public ReadAttribute { +class ReadNetworkCommissioningMaxNetworks : public ReadAttribute { public: - ReadScenesSceneCount() - : ReadAttribute("scene-count") + ReadNetworkCommissioningMaxNetworks() + : ReadAttribute("max-networks") { } - ~ReadScenesSceneCount() {} + ~ReadNetworkCommissioningMaxNetworks() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSceneCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.SceneCount response %@", [value description]); + [cluster readAttributeMaxNetworksWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes SceneCount read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning MaxNetworks read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50700,34 +54561,36 @@ class ReadScenesSceneCount : public ReadAttribute { } }; -class SubscribeAttributeScenesSceneCount : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningMaxNetworks : public SubscribeAttribute { public: - SubscribeAttributeScenesSceneCount() - : SubscribeAttribute("scene-count") + SubscribeAttributeNetworkCommissioningMaxNetworks() + : SubscribeAttribute("max-networks") { } - ~SubscribeAttributeScenesSceneCount() {} + ~SubscribeAttributeNetworkCommissioningMaxNetworks() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSceneCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.SceneCount response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeMaxNetworksWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -50739,30 +54602,32 @@ class SubscribeAttributeScenesSceneCount : public SubscribeAttribute { }; /* - * Attribute CurrentScene + * Attribute Networks */ -class ReadScenesCurrentScene : public ReadAttribute { +class ReadNetworkCommissioningNetworks : public ReadAttribute { public: - ReadScenesCurrentScene() - : ReadAttribute("current-scene") + ReadNetworkCommissioningNetworks() + : ReadAttribute("networks") { } - ~ReadScenesCurrentScene() {} + ~ReadNetworkCommissioningNetworks() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentSceneWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.CurrentScene response %@", [value description]); + [cluster readAttributeNetworksWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.Networks response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes CurrentScene read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning Networks read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50770,34 +54635,36 @@ class ReadScenesCurrentScene : public ReadAttribute { } }; -class SubscribeAttributeScenesCurrentScene : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningNetworks : public SubscribeAttribute { public: - SubscribeAttributeScenesCurrentScene() - : SubscribeAttribute("current-scene") + SubscribeAttributeNetworkCommissioningNetworks() + : SubscribeAttribute("networks") { } - ~SubscribeAttributeScenesCurrentScene() {} + ~SubscribeAttributeNetworkCommissioningNetworks() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentSceneWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.CurrentScene response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNetworksWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.Networks response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -50809,30 +54676,32 @@ class SubscribeAttributeScenesCurrentScene : public SubscribeAttribute { }; /* - * Attribute CurrentGroup + * Attribute ScanMaxTimeSeconds */ -class ReadScenesCurrentGroup : public ReadAttribute { +class ReadNetworkCommissioningScanMaxTimeSeconds : public ReadAttribute { public: - ReadScenesCurrentGroup() - : ReadAttribute("current-group") + ReadNetworkCommissioningScanMaxTimeSeconds() + : ReadAttribute("scan-max-time-seconds") { } - ~ReadScenesCurrentGroup() {} + ~ReadNetworkCommissioningScanMaxTimeSeconds() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentGroupWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.CurrentGroup response %@", [value description]); + [cluster readAttributeScanMaxTimeSecondsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes CurrentGroup read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning ScanMaxTimeSeconds read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50840,34 +54709,37 @@ class ReadScenesCurrentGroup : public ReadAttribute { } }; -class SubscribeAttributeScenesCurrentGroup : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds : public SubscribeAttribute { public: - SubscribeAttributeScenesCurrentGroup() - : SubscribeAttribute("current-group") + SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds() + : SubscribeAttribute("scan-max-time-seconds") { } - ~SubscribeAttributeScenesCurrentGroup() {} + ~SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentGroupWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.CurrentGroup response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeScanMaxTimeSecondsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -50879,30 +54751,32 @@ class SubscribeAttributeScenesCurrentGroup : public SubscribeAttribute { }; /* - * Attribute SceneValid + * Attribute ConnectMaxTimeSeconds */ -class ReadScenesSceneValid : public ReadAttribute { +class ReadNetworkCommissioningConnectMaxTimeSeconds : public ReadAttribute { public: - ReadScenesSceneValid() - : ReadAttribute("scene-valid") + ReadNetworkCommissioningConnectMaxTimeSeconds() + : ReadAttribute("connect-max-time-seconds") { } - ~ReadScenesSceneValid() {} + ~ReadNetworkCommissioningConnectMaxTimeSeconds() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSceneValidWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.SceneValid response %@", [value description]); + [cluster readAttributeConnectMaxTimeSecondsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes SceneValid read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning ConnectMaxTimeSeconds read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50910,34 +54784,37 @@ class ReadScenesSceneValid : public ReadAttribute { } }; -class SubscribeAttributeScenesSceneValid : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds : public SubscribeAttribute { public: - SubscribeAttributeScenesSceneValid() - : SubscribeAttribute("scene-valid") + SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds() + : SubscribeAttribute("connect-max-time-seconds") { } - ~SubscribeAttributeScenesSceneValid() {} + ~SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSceneValidWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.SceneValid response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeConnectMaxTimeSecondsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -50949,30 +54826,32 @@ class SubscribeAttributeScenesSceneValid : public SubscribeAttribute { }; /* - * Attribute NameSupport + * Attribute InterfaceEnabled */ -class ReadScenesNameSupport : public ReadAttribute { +class ReadNetworkCommissioningInterfaceEnabled : public ReadAttribute { public: - ReadScenesNameSupport() - : ReadAttribute("name-support") + ReadNetworkCommissioningInterfaceEnabled() + : ReadAttribute("interface-enabled") { } - ~ReadScenesNameSupport() {} + ~ReadNetworkCommissioningInterfaceEnabled() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.NameSupport response %@", [value description]); + [cluster readAttributeInterfaceEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes NameSupport read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning InterfaceEnabled read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -50980,36 +54859,81 @@ class ReadScenesNameSupport : public ReadAttribute { } }; -class SubscribeAttributeScenesNameSupport : public SubscribeAttribute { +class WriteNetworkCommissioningInterfaceEnabled : public WriteAttribute { public: - SubscribeAttributeScenesNameSupport() - : SubscribeAttribute("name-support") + WriteNetworkCommissioningInterfaceEnabled() + : WriteAttribute("interface-enabled") { + AddArgument("attr-name", "interface-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeScenesNameSupport() {} + ~WriteNetworkCommissioningInterfaceEnabled() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) WriteAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNameSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.NameSupport response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - return CHIP_NO_ERROR; + [cluster writeAttributeInterfaceEnabledWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "NetworkCommissioning InterfaceEnabled write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeNetworkCommissioningInterfaceEnabled : public SubscribeAttribute { +public: + SubscribeAttributeNetworkCommissioningInterfaceEnabled() + : SubscribeAttribute("interface-enabled") + { + } + + ~SubscribeAttributeNetworkCommissioningInterfaceEnabled() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInterfaceEnabledWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } chip::System::Clock::Timeout GetWaitDuration() const override @@ -51019,30 +54943,32 @@ class SubscribeAttributeScenesNameSupport : public SubscribeAttribute { }; /* - * Attribute GeneratedCommandList + * Attribute LastNetworkingStatus */ -class ReadScenesGeneratedCommandList : public ReadAttribute { +class ReadNetworkCommissioningLastNetworkingStatus : public ReadAttribute { public: - ReadScenesGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadNetworkCommissioningLastNetworkingStatus() + : ReadAttribute("last-networking-status") { } - ~ReadScenesGeneratedCommandList() {} + ~ReadNetworkCommissioningLastNetworkingStatus() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); + [cluster readAttributeLastNetworkingStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning LastNetworkingStatus read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51050,30 +54976,33 @@ class ReadScenesGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeScenesGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningLastNetworkingStatus : public SubscribeAttribute { public: - SubscribeAttributeScenesGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeNetworkCommissioningLastNetworkingStatus() + : SubscribeAttribute("last-networking-status") { } - ~SubscribeAttributeScenesGeneratedCommandList() {} + ~SubscribeAttributeNetworkCommissioningLastNetworkingStatus() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeLastNetworkingStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -51089,30 +55018,32 @@ class SubscribeAttributeScenesGeneratedCommandList : public SubscribeAttribute { }; /* - * Attribute AcceptedCommandList + * Attribute LastNetworkID */ -class ReadScenesAcceptedCommandList : public ReadAttribute { +class ReadNetworkCommissioningLastNetworkID : public ReadAttribute { public: - ReadScenesAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadNetworkCommissioningLastNetworkID() + : ReadAttribute("last-network-id") { } - ~ReadScenesAcceptedCommandList() {} + ~ReadNetworkCommissioningLastNetworkID() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); + [cluster readAttributeLastNetworkIDWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning LastNetworkID read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51120,34 +55051,36 @@ class ReadScenesAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeScenesAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningLastNetworkID : public SubscribeAttribute { public: - SubscribeAttributeScenesAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + SubscribeAttributeNetworkCommissioningLastNetworkID() + : SubscribeAttribute("last-network-id") { } - ~SubscribeAttributeScenesAcceptedCommandList() {} + ~SubscribeAttributeNetworkCommissioningLastNetworkID() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLastNetworkIDWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -51159,30 +55092,32 @@ class SubscribeAttributeScenesAcceptedCommandList : public SubscribeAttribute { }; /* - * Attribute AttributeList + * Attribute LastConnectErrorValue */ -class ReadScenesAttributeList : public ReadAttribute { +class ReadNetworkCommissioningLastConnectErrorValue : public ReadAttribute { public: - ReadScenesAttributeList() - : ReadAttribute("attribute-list") + ReadNetworkCommissioningLastConnectErrorValue() + : ReadAttribute("last-connect-error-value") { } - ~ReadScenesAttributeList() {} + ~ReadNetworkCommissioningLastConnectErrorValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.AttributeList response %@", [value description]); + [cluster readAttributeLastConnectErrorValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning LastConnectErrorValue read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51190,34 +55125,37 @@ class ReadScenesAttributeList : public ReadAttribute { } }; -class SubscribeAttributeScenesAttributeList : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public SubscribeAttribute { public: - SubscribeAttributeScenesAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeNetworkCommissioningLastConnectErrorValue() + : SubscribeAttribute("last-connect-error-value") { } - ~SubscribeAttributeScenesAttributeList() {} + ~SubscribeAttributeNetworkCommissioningLastConnectErrorValue() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLastConnectErrorValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -51229,30 +55167,32 @@ class SubscribeAttributeScenesAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute GeneratedCommandList */ -class ReadScenesClusterRevision : public ReadAttribute { +class ReadNetworkCommissioningGeneratedCommandList : public ReadAttribute { public: - ReadScenesClusterRevision() - : ReadAttribute("cluster-revision") + ReadNetworkCommissioningGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadScenesClusterRevision() {} + ~ReadNetworkCommissioningGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.ClusterRevision response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Scenes ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51260,34 +55200,37 @@ class ReadScenesClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeScenesClusterRevision : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeScenesClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeNetworkCommissioningGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeScenesClusterRevision() {} + ~SubscribeAttributeNetworkCommissioningGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Scenes.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -51298,98 +55241,108 @@ class SubscribeAttributeScenesClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster SoftwareDiagnostics | 0x0034 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ResetWatermarks | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ThreadMetrics | 0x0000 | -| * CurrentHeapFree | 0x0001 | -| * CurrentHeapUsed | 0x0002 | -| * CurrentHeapHighWatermark | 0x0003 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * SoftwareFault | 0x0000 | -\*----------------------------------------------------------------------------*/ - /* - * Command ResetWatermarks + * Attribute AcceptedCommandList */ -class SoftwareDiagnosticsResetWatermarks : public ClusterCommand { +class ReadNetworkCommissioningAcceptedCommandList : public ReadAttribute { public: - SoftwareDiagnosticsResetWatermarks() - : ClusterCommand("reset-watermarks") + ReadNetworkCommissioningAcceptedCommandList() + : ReadAttribute("accepted-command-list") { - ClusterCommand::AddArguments(); } + ~ReadNetworkCommissioningAcceptedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPSoftwareDiagnosticsClusterResetWatermarksParams 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 resetWatermarksWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "NetworkCommissioning AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } +}; -private: +class SubscribeAttributeNetworkCommissioningAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeNetworkCommissioningAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeNetworkCommissioningAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Attribute ThreadMetrics + * Attribute AttributeList */ -class ReadSoftwareDiagnosticsThreadMetrics : public ReadAttribute { +class ReadNetworkCommissioningAttributeList : public ReadAttribute { public: - ReadSoftwareDiagnosticsThreadMetrics() - : ReadAttribute("thread-metrics") + ReadNetworkCommissioningAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadSoftwareDiagnosticsThreadMetrics() {} + ~ReadNetworkCommissioningAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics ThreadMetrics read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51397,32 +55350,32 @@ class ReadSoftwareDiagnosticsThreadMetrics : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsThreadMetrics : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningAttributeList : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsThreadMetrics() - : SubscribeAttribute("thread-metrics") + SubscribeAttributeNetworkCommissioningAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeSoftwareDiagnosticsThreadMetrics() {} + ~SubscribeAttributeNetworkCommissioningAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeThreadMetricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); + NSLog(@"NetworkCommissioning.AttributeList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -51438,32 +55391,32 @@ class SubscribeAttributeSoftwareDiagnosticsThreadMetrics : public SubscribeAttri }; /* - * Attribute CurrentHeapFree + * Attribute FeatureMap */ -class ReadSoftwareDiagnosticsCurrentHeapFree : public ReadAttribute { +class ReadNetworkCommissioningFeatureMap : public ReadAttribute { public: - ReadSoftwareDiagnosticsCurrentHeapFree() - : ReadAttribute("current-heap-free") + ReadNetworkCommissioningFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadSoftwareDiagnosticsCurrentHeapFree() {} + ~ReadNetworkCommissioningFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics CurrentHeapFree read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51471,33 +55424,32 @@ class ReadSoftwareDiagnosticsCurrentHeapFree : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree() - : SubscribeAttribute("current-heap-free") + SubscribeAttributeNetworkCommissioningFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree() {} + ~SubscribeAttributeNetworkCommissioningFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeCurrentHeapFreeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); + NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -51513,32 +55465,32 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree : public SubscribeAtt }; /* - * Attribute CurrentHeapUsed + * Attribute ClusterRevision */ -class ReadSoftwareDiagnosticsCurrentHeapUsed : public ReadAttribute { +class ReadNetworkCommissioningClusterRevision : public ReadAttribute { public: - ReadSoftwareDiagnosticsCurrentHeapUsed() - : ReadAttribute("current-heap-used") + ReadNetworkCommissioningClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadSoftwareDiagnosticsCurrentHeapUsed() {} + ~ReadNetworkCommissioningClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics CurrentHeapUsed read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "NetworkCommissioning ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51546,33 +55498,33 @@ class ReadSoftwareDiagnosticsCurrentHeapUsed : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed : public SubscribeAttribute { +class SubscribeAttributeNetworkCommissioningClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed() - : SubscribeAttribute("current-heap-used") + SubscribeAttributeNetworkCommissioningClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed() {} + ~SubscribeAttributeNetworkCommissioningClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeCurrentHeapUsedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); + NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -51587,110 +55539,254 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed : public SubscribeAtt } }; +/*----------------------------------------------------------------------------*\ +| Cluster OtaSoftwareUpdateProvider | 0x0029 | +|------------------------------------------------------------------------------| +| Commands: | | +| * QueryImage | 0x00 | +| * ApplyUpdateRequest | 0x02 | +| * NotifyUpdateApplied | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute CurrentHeapHighWatermark + * Command QueryImage */ -class ReadSoftwareDiagnosticsCurrentHeapHighWatermark : public ReadAttribute { +class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { public: - ReadSoftwareDiagnosticsCurrentHeapHighWatermark() - : ReadAttribute("current-heap-high-watermark") - { - } - - ~ReadSoftwareDiagnosticsCurrentHeapHighWatermark() {} + OtaSoftwareUpdateProviderQueryImage() + : ClusterCommand("query-image") + , mComplex_ProtocolsSupported(&mRequest.protocolsSupported) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("VendorId", 0, UINT16_MAX, &mVendorId); + AddArgument("ProductId", 0, UINT16_MAX, &mProductId); + AddArgument("SoftwareVersion", 0, UINT32_MAX, &mSoftwareVersion); + AddArgument("ProtocolsSupported", &mComplex_ProtocolsSupported); + AddArgument("HardwareVersion", 0, UINT16_MAX, &mHardwareVersion); + AddArgument("Location", &mLocation); + AddArgument("RequestorCanConsent", 0, 1, &mRequestorCanConsent); + AddArgument("MetadataForProvider", &mMetadataForProvider); + ClusterCommand::AddArguments(); + } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics CurrentHeapHighWatermark read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterQueryImageParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; + params.productId = [NSNumber numberWithUnsignedShort:mProductId]; + params.softwareVersion = [NSNumber numberWithUnsignedInt:mSoftwareVersion]; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.protocolsSupported) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + params.protocolsSupported = array_0; + } + if (mHardwareVersion.HasValue()) { + params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion.Value()]; + } + if (mLocation.HasValue()) { + params.location = [[NSString alloc] initWithBytes:mLocation.Value().data() + length:mLocation.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (mRequestorCanConsent.HasValue()) { + params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent.Value()]; + } + if (mMetadataForProvider.HasValue()) { + params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.Value().data() + length:mMetadataForProvider.Value().size()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster queryImageWithParams:params + completionHandler:^(CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type mRequest; + chip::VendorId mVendorId; + uint16_t mProductId; + uint32_t mSoftwareVersion; + TypedComplexArgument> + mComplex_ProtocolsSupported; + chip::Optional mHardwareVersion; + chip::Optional mLocation; + chip::Optional mRequestorCanConsent; + chip::Optional mMetadataForProvider; }; -class SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark : public SubscribeAttribute { +/* + * Command ApplyUpdateRequest + */ +class OtaSoftwareUpdateProviderApplyUpdateRequest : public ClusterCommand { public: - SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark() - : SubscribeAttribute("current-heap-high-watermark") + OtaSoftwareUpdateProviderApplyUpdateRequest() + : ClusterCommand("apply-update-request") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UpdateToken", &mUpdateToken); + AddArgument("NewVersion", 0, UINT32_MAX, &mNewVersion); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeCurrentHeapHighWatermarkWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.updateToken = [[NSData alloc] initWithBytes:mUpdateToken.data() length:mUpdateToken.size()]; + params.newVersion = [NSNumber numberWithUnsignedInt:mNewVersion]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + applyUpdateRequestWithParams:params + completionHandler:^(CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } - return CHIP_NO_ERROR; +private: + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type mRequest; + chip::ByteSpan mUpdateToken; + uint32_t mNewVersion; +}; + +/* + * Command NotifyUpdateApplied + */ +class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ClusterCommand { +public: + OtaSoftwareUpdateProviderNotifyUpdateApplied() + : ClusterCommand("notify-update-applied") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("UpdateToken", &mUpdateToken); + AddArgument("SoftwareVersion", 0, UINT32_MAX, &mSoftwareVersion); + ClusterCommand::AddArguments(); } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.updateToken = [[NSData alloc] initWithBytes:mUpdateToken.data() length:mUpdateToken.size()]; + params.softwareVersion = [NSNumber numberWithUnsignedInt:mSoftwareVersion]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster notifyUpdateAppliedWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type mRequest; + chip::ByteSpan mUpdateToken; + uint32_t mSoftwareVersion; }; /* * Attribute GeneratedCommandList */ -class ReadSoftwareDiagnosticsGeneratedCommandList : public ReadAttribute { +class ReadOtaSoftwareUpdateProviderGeneratedCommandList : public ReadAttribute { public: - ReadSoftwareDiagnosticsGeneratedCommandList() + ReadOtaSoftwareUpdateProviderGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadSoftwareDiagnosticsGeneratedCommandList() {} + ~ReadOtaSoftwareUpdateProviderGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateProvider.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateProvider GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51698,22 +55794,22 @@ class ReadSoftwareDiagnosticsGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateProviderGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList() + SubscribeAttributeOtaSoftwareUpdateProviderGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList() {} + ~SubscribeAttributeOtaSoftwareUpdateProviderGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -51723,7 +55819,7 @@ class SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList : public Subscri params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", + NSLog(@"OtaSoftwareUpdateProvider.GeneratedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -51742,30 +55838,30 @@ class SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList : public Subscri /* * Attribute AcceptedCommandList */ -class ReadSoftwareDiagnosticsAcceptedCommandList : public ReadAttribute { +class ReadOtaSoftwareUpdateProviderAcceptedCommandList : public ReadAttribute { public: - ReadSoftwareDiagnosticsAcceptedCommandList() + ReadOtaSoftwareUpdateProviderAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadSoftwareDiagnosticsAcceptedCommandList() {} + ~ReadOtaSoftwareUpdateProviderAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateProvider.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateProvider AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51773,22 +55869,22 @@ class ReadSoftwareDiagnosticsAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateProviderAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList() + SubscribeAttributeOtaSoftwareUpdateProviderAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList() {} + ~SubscribeAttributeOtaSoftwareUpdateProviderAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -51798,7 +55894,7 @@ class SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList : public Subscrib params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", + NSLog(@"OtaSoftwareUpdateProvider.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -51817,30 +55913,30 @@ class SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList : public Subscrib /* * Attribute AttributeList */ -class ReadSoftwareDiagnosticsAttributeList : public ReadAttribute { +class ReadOtaSoftwareUpdateProviderAttributeList : public ReadAttribute { public: - ReadSoftwareDiagnosticsAttributeList() + ReadOtaSoftwareUpdateProviderAttributeList() : ReadAttribute("attribute-list") { } - ~ReadSoftwareDiagnosticsAttributeList() {} + ~ReadOtaSoftwareUpdateProviderAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateProvider.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateProvider AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51848,36 +55944,37 @@ class ReadSoftwareDiagnosticsAttributeList : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsAttributeList : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateProviderAttributeList : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsAttributeList() + SubscribeAttributeOtaSoftwareUpdateProviderAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeSoftwareDiagnosticsAttributeList() {} + ~SubscribeAttributeOtaSoftwareUpdateProviderAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateProvider.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -51891,30 +55988,30 @@ class SubscribeAttributeSoftwareDiagnosticsAttributeList : public SubscribeAttri /* * Attribute FeatureMap */ -class ReadSoftwareDiagnosticsFeatureMap : public ReadAttribute { +class ReadOtaSoftwareUpdateProviderFeatureMap : public ReadAttribute { public: - ReadSoftwareDiagnosticsFeatureMap() + ReadOtaSoftwareUpdateProviderFeatureMap() : ReadAttribute("feature-map") { } - ~ReadSoftwareDiagnosticsFeatureMap() {} + ~ReadOtaSoftwareUpdateProviderFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); + NSLog(@"OtaSoftwareUpdateProvider.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateProvider FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51922,22 +56019,22 @@ class ReadSoftwareDiagnosticsFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsFeatureMap : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateProviderFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsFeatureMap() + SubscribeAttributeOtaSoftwareUpdateProviderFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeSoftwareDiagnosticsFeatureMap() {} + ~SubscribeAttributeOtaSoftwareUpdateProviderFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -51947,7 +56044,7 @@ class SubscribeAttributeSoftwareDiagnosticsFeatureMap : public SubscribeAttribut params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); + NSLog(@"OtaSoftwareUpdateProvider.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -51965,30 +56062,30 @@ class SubscribeAttributeSoftwareDiagnosticsFeatureMap : public SubscribeAttribut /* * Attribute ClusterRevision */ -class ReadSoftwareDiagnosticsClusterRevision : public ReadAttribute { +class ReadOtaSoftwareUpdateProviderClusterRevision : public ReadAttribute { public: - ReadSoftwareDiagnosticsClusterRevision() + ReadOtaSoftwareUpdateProviderClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadSoftwareDiagnosticsClusterRevision() {} + ~ReadOtaSoftwareUpdateProviderClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); + NSLog(@"OtaSoftwareUpdateProvider.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "SoftwareDiagnostics ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateProvider ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -51996,37 +56093,37 @@ class ReadSoftwareDiagnosticsClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeSoftwareDiagnosticsClusterRevision : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeSoftwareDiagnosticsClusterRevision() + SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeSoftwareDiagnosticsClusterRevision() {} + ~SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateProvider.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52038,14 +56135,16 @@ class SubscribeAttributeSoftwareDiagnosticsClusterRevision : public SubscribeAtt }; /*----------------------------------------------------------------------------*\ -| Cluster Switch | 0x003B | +| Cluster OtaSoftwareUpdateRequestor | 0x002A | |------------------------------------------------------------------------------| | Commands: | | +| * AnnounceOtaProvider | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * NumberOfPositions | 0x0000 | -| * CurrentPosition | 0x0001 | -| * MultiPressMax | 0x0002 | +| * DefaultOtaProviders | 0x0000 | +| * UpdatePossible | 0x0001 | +| * UpdateState | 0x0002 | +| * UpdateStateProgress | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -52053,75 +56152,205 @@ class SubscribeAttributeSoftwareDiagnosticsClusterRevision : public SubscribeAtt | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | -| * SwitchLatched | 0x0000 | -| * InitialPress | 0x0001 | -| * LongPress | 0x0002 | -| * ShortRelease | 0x0003 | -| * LongRelease | 0x0004 | -| * MultiPressOngoing | 0x0005 | -| * MultiPressComplete | 0x0006 | +| * StateTransition | 0x0000 | +| * VersionApplied | 0x0001 | +| * DownloadError | 0x0002 | \*----------------------------------------------------------------------------*/ /* - * Attribute NumberOfPositions + * Command AnnounceOtaProvider */ -class ReadSwitchNumberOfPositions : public ReadAttribute { +class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ClusterCommand { public: - ReadSwitchNumberOfPositions() - : ReadAttribute("number-of-positions") + OtaSoftwareUpdateRequestorAnnounceOtaProvider() + : ClusterCommand("announce-ota-provider") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("ProviderNodeId", 0, UINT64_MAX, &mProviderNodeId); + AddArgument("VendorId", 0, UINT16_MAX, &mVendorId); + AddArgument("AnnouncementReason", 0, UINT8_MAX, &mAnnouncementReason); + AddArgument("MetadataForNode", &mMetadataForNode); + AddArgument("Endpoint", 0, UINT16_MAX, &mEndpoint); + ClusterCommand::AddArguments(); } - ~ReadSwitchNumberOfPositions() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.NumberOfPositions response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "Switch NumberOfPositions read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.providerNodeId = [NSNumber numberWithUnsignedLongLong:mProviderNodeId]; + params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; + params.announcementReason = [NSNumber numberWithUnsignedChar:mAnnouncementReason]; + if (mMetadataForNode.HasValue()) { + params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.Value().data() + length:mMetadataForNode.Value().size()]; + } + params.endpoint = [NSNumber numberWithUnsignedShort:mEndpoint]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster announceOtaProviderWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type mRequest; + chip::NodeId mProviderNodeId; + chip::VendorId mVendorId; + uint8_t mAnnouncementReason; + chip::Optional mMetadataForNode; + chip::EndpointId mEndpoint; }; -class SubscribeAttributeSwitchNumberOfPositions : public SubscribeAttribute { +/* + * Attribute DefaultOtaProviders + */ +class ReadOtaSoftwareUpdateRequestorDefaultOtaProviders : public ReadAttribute { public: - SubscribeAttributeSwitchNumberOfPositions() - : SubscribeAttribute("number-of-positions") + ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() + : ReadAttribute("default-ota-providers") { } - ~SubscribeAttributeSwitchNumberOfPositions() {} + ~ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNumberOfPositionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.NumberOfPositions response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + readAttributeDefaultOtaProvidersWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.DefaultOtaProviders response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor DefaultOtaProviders read Error: %s", + chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteOtaSoftwareUpdateRequestorDefaultOtaProviders : public WriteAttribute { +public: + WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() + : WriteAttribute("default-ota-providers") + , mComplex(&mValue) + { + AddArgument("attr-name", "default-ota-providers"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) WriteAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPOtaSoftwareUpdateRequestorClusterProviderLocation * newElement_0; + newElement_0 = [CHIPOtaSoftwareUpdateRequestorClusterProviderLocation new]; + newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeDefaultOtaProvidersWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OtaSoftwareUpdateRequestor DefaultOtaProviders write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; +}; + +class SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders : public SubscribeAttribute { +public: + SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders() + : SubscribeAttribute("default-ota-providers") + { + } + + ~SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeDefaultOtaProvidersWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.DefaultOtaProviders response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52133,30 +56362,32 @@ class SubscribeAttributeSwitchNumberOfPositions : public SubscribeAttribute { }; /* - * Attribute CurrentPosition + * Attribute UpdatePossible */ -class ReadSwitchCurrentPosition : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorUpdatePossible : public ReadAttribute { public: - ReadSwitchCurrentPosition() - : ReadAttribute("current-position") + ReadOtaSoftwareUpdateRequestorUpdatePossible() + : ReadAttribute("update-possible") { } - ~ReadSwitchCurrentPosition() {} + ~ReadOtaSoftwareUpdateRequestorUpdatePossible() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.CurrentPosition response %@", [value description]); + [cluster readAttributeUpdatePossibleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.UpdatePossible response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch CurrentPosition read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor UpdatePossible read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52164,34 +56395,37 @@ class ReadSwitchCurrentPosition : public ReadAttribute { } }; -class SubscribeAttributeSwitchCurrentPosition : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible : public SubscribeAttribute { public: - SubscribeAttributeSwitchCurrentPosition() - : SubscribeAttribute("current-position") + SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible() + : SubscribeAttribute("update-possible") { } - ~SubscribeAttributeSwitchCurrentPosition() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.CurrentPosition response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeUpdatePossibleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.UpdatePossible response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52203,30 +56437,32 @@ class SubscribeAttributeSwitchCurrentPosition : public SubscribeAttribute { }; /* - * Attribute MultiPressMax + * Attribute UpdateState */ -class ReadSwitchMultiPressMax : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorUpdateState : public ReadAttribute { public: - ReadSwitchMultiPressMax() - : ReadAttribute("multi-press-max") + ReadOtaSoftwareUpdateRequestorUpdateState() + : ReadAttribute("update-state") { } - ~ReadSwitchMultiPressMax() {} + ~ReadOtaSoftwareUpdateRequestorUpdateState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.MultiPressMax response %@", [value description]); + [cluster readAttributeUpdateStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.UpdateState response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch MultiPressMax read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor UpdateState read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52234,34 +56470,112 @@ class ReadSwitchMultiPressMax : public ReadAttribute { } }; -class SubscribeAttributeSwitchMultiPressMax : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState : public SubscribeAttribute { public: - SubscribeAttributeSwitchMultiPressMax() - : SubscribeAttribute("multi-press-max") + SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState() + : SubscribeAttribute("update-state") { } - ~SubscribeAttributeSwitchMultiPressMax() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMultiPressMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.MultiPressMax response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeUpdateStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.UpdateState response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute UpdateStateProgress + */ +class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ReadAttribute { +public: + ReadOtaSoftwareUpdateRequestorUpdateStateProgress() + : ReadAttribute("update-state-progress") + { + } + + ~ReadOtaSoftwareUpdateRequestorUpdateStateProgress() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeUpdateStateProgressWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.UpdateStateProgress response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor UpdateStateProgress read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress : public SubscribeAttribute { +public: + SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress() + : SubscribeAttribute("update-state-progress") + { + } + + ~SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeUpdateStateProgressWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OtaSoftwareUpdateRequestor.UpdateStateProgress response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52275,28 +56589,30 @@ class SubscribeAttributeSwitchMultiPressMax : public SubscribeAttribute { /* * Attribute GeneratedCommandList */ -class ReadSwitchGeneratedCommandList : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorGeneratedCommandList : public ReadAttribute { public: - ReadSwitchGeneratedCommandList() + ReadOtaSoftwareUpdateRequestorGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadSwitchGeneratedCommandList() {} + ~ReadOtaSoftwareUpdateRequestorGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.GeneratedCommandList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52304,20 +56620,22 @@ class ReadSwitchGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeSwitchGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeSwitchGeneratedCommandList() + SubscribeAttributeOtaSoftwareUpdateRequestorGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeSwitchGeneratedCommandList() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -52327,7 +56645,8 @@ class SubscribeAttributeSwitchGeneratedCommandList : public SubscribeAttribute { params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.GeneratedCommandList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.GeneratedCommandList response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -52345,28 +56664,30 @@ class SubscribeAttributeSwitchGeneratedCommandList : public SubscribeAttribute { /* * Attribute AcceptedCommandList */ -class ReadSwitchAcceptedCommandList : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorAcceptedCommandList : public ReadAttribute { public: - ReadSwitchAcceptedCommandList() + ReadOtaSoftwareUpdateRequestorAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadSwitchAcceptedCommandList() {} + ~ReadOtaSoftwareUpdateRequestorAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.AcceptedCommandList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52374,20 +56695,22 @@ class ReadSwitchAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeSwitchAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeSwitchAcceptedCommandList() + SubscribeAttributeOtaSoftwareUpdateRequestorAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeSwitchAcceptedCommandList() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -52397,7 +56720,8 @@ class SubscribeAttributeSwitchAcceptedCommandList : public SubscribeAttribute { params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.AcceptedCommandList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.AcceptedCommandList response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -52415,28 +56739,30 @@ class SubscribeAttributeSwitchAcceptedCommandList : public SubscribeAttribute { /* * Attribute AttributeList */ -class ReadSwitchAttributeList : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorAttributeList : public ReadAttribute { public: - ReadSwitchAttributeList() + ReadOtaSoftwareUpdateRequestorAttributeList() : ReadAttribute("attribute-list") { } - ~ReadSwitchAttributeList() {} + ~ReadOtaSoftwareUpdateRequestorAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.AttributeList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52444,20 +56770,22 @@ class ReadSwitchAttributeList : public ReadAttribute { } }; -class SubscribeAttributeSwitchAttributeList : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList : public SubscribeAttribute { public: - SubscribeAttributeSwitchAttributeList() + SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeSwitchAttributeList() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -52467,7 +56795,8 @@ class SubscribeAttributeSwitchAttributeList : public SubscribeAttribute { params:params subscriptionEstablished:nullptr reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.AttributeList response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.AttributeList response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -52485,28 +56814,30 @@ class SubscribeAttributeSwitchAttributeList : public SubscribeAttribute { /* * Attribute FeatureMap */ -class ReadSwitchFeatureMap : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorFeatureMap : public ReadAttribute { public: - ReadSwitchFeatureMap() + ReadOtaSoftwareUpdateRequestorFeatureMap() : ReadAttribute("feature-map") { } - ~ReadSwitchFeatureMap() {} + ~ReadOtaSoftwareUpdateRequestorFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.FeatureMap response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch FeatureMap read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52514,20 +56845,22 @@ class ReadSwitchFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeSwitchFeatureMap : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeSwitchFeatureMap() + SubscribeAttributeOtaSoftwareUpdateRequestorFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeSwitchFeatureMap() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -52537,7 +56870,7 @@ class SubscribeAttributeSwitchFeatureMap : public SubscribeAttribute { params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.FeatureMap response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.FeatureMap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -52555,28 +56888,30 @@ class SubscribeAttributeSwitchFeatureMap : public SubscribeAttribute { /* * Attribute ClusterRevision */ -class ReadSwitchClusterRevision : public ReadAttribute { +class ReadOtaSoftwareUpdateRequestorClusterRevision : public ReadAttribute { public: - ReadSwitchClusterRevision() + ReadOtaSoftwareUpdateRequestorClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadSwitchClusterRevision() {} + ~ReadOtaSoftwareUpdateRequestorClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.ClusterRevision response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Switch ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52584,20 +56919,22 @@ class ReadSwitchClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { +class SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeSwitchClusterRevision() + SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeSwitchClusterRevision() {} + ~SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; @@ -52607,7 +56944,8 @@ class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Switch.ClusterRevision response %@", [value description]); + NSLog(@"OtaSoftwareUpdateRequestor.ClusterRevision response %@", + [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -52623,14 +56961,23 @@ class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { }; /*----------------------------------------------------------------------------*\ -| Cluster TargetNavigator | 0x0505 | +| Cluster OccupancySensing | 0x0406 | |------------------------------------------------------------------------------| | Commands: | | -| * NavigateTarget | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * TargetList | 0x0000 | -| * CurrentTarget | 0x0001 | +| * Occupancy | 0x0000 | +| * OccupancySensorType | 0x0001 | +| * OccupancySensorTypeBitmap | 0x0002 | +| * PirOccupiedToUnoccupiedDelay | 0x0010 | +| * PirUnoccupiedToOccupiedDelay | 0x0011 | +| * PirUnoccupiedToOccupiedThreshold | 0x0012 | +| * UltrasonicOccupiedToUnoccupiedDelay | 0x0020 | +| * UltrasonicUnoccupiedToOccupiedDelay | 0x0021 | +| * UltrasonicUnoccupiedToOccupiedThreshold | 0x0022 | +| * PhysicalContactOccupiedToUnoccupiedDelay | 0x0030 | +| * PhysicalContactUnoccupiedToOccupiedDelay | 0x0031 | +| * PhysicalContactUnoccupiedToOccupiedThreshold | 0x0032 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -52641,120 +56988,69 @@ class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { \*----------------------------------------------------------------------------*/ /* - * Command NavigateTarget + * Attribute Occupancy */ -class TargetNavigatorNavigateTarget : public ClusterCommand { +class ReadOccupancySensingOccupancy : public ReadAttribute { public: - TargetNavigatorNavigateTarget() - : ClusterCommand("navigate-target") + ReadOccupancySensingOccupancy() + : ReadAttribute("occupancy") { - AddArgument("Target", 0, UINT8_MAX, &mTarget); - AddArgument("Data", &mData); - ClusterCommand::AddArguments(); } + ~ReadOccupancySensingOccupancy() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTargetNavigatorClusterNavigateTargetParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.target = [NSNumber numberWithUnsignedChar:mTarget]; - if (mData.HasValue()) { - params.data = [[NSString alloc] initWithBytes:mData.Value().data() - length:mData.Value().size() - encoding:NSUTF8StringEncoding]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster navigateTargetWithParams:params - completionHandler:^(CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.Occupancy response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mTarget; - chip::Optional mData; + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing Occupancy read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Attribute TargetList - */ -class ReadTargetNavigatorTargetList : public ReadAttribute { +class SubscribeAttributeOccupancySensingOccupancy : public SubscribeAttribute { public: - ReadTargetNavigatorTargetList() - : ReadAttribute("target-list") + SubscribeAttributeOccupancySensingOccupancy() + : SubscribeAttribute("occupancy") { } - ~ReadTargetNavigatorTargetList() {} + ~SubscribeAttributeOccupancySensingOccupancy() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.TargetList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "TargetNavigator TargetList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class SubscribeAttributeTargetNavigatorTargetList : public SubscribeAttribute { -public: - SubscribeAttributeTargetNavigatorTargetList() - : SubscribeAttribute("target-list") - { - } - - ~SubscribeAttributeTargetNavigatorTargetList() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTargetListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.TargetList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOccupancyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.Occupancy response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52766,30 +57062,32 @@ class SubscribeAttributeTargetNavigatorTargetList : public SubscribeAttribute { }; /* - * Attribute CurrentTarget + * Attribute OccupancySensorType */ -class ReadTargetNavigatorCurrentTarget : public ReadAttribute { +class ReadOccupancySensingOccupancySensorType : public ReadAttribute { public: - ReadTargetNavigatorCurrentTarget() - : ReadAttribute("current-target") + ReadOccupancySensingOccupancySensorType() + : ReadAttribute("occupancy-sensor-type") { } - ~ReadTargetNavigatorCurrentTarget() {} + ~ReadOccupancySensingOccupancySensorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); + [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.OccupancySensorType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TargetNavigator CurrentTarget read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OccupancySensing OccupancySensorType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52797,34 +57095,37 @@ class ReadTargetNavigatorCurrentTarget : public ReadAttribute { } }; -class SubscribeAttributeTargetNavigatorCurrentTarget : public SubscribeAttribute { +class SubscribeAttributeOccupancySensingOccupancySensorType : public SubscribeAttribute { public: - SubscribeAttributeTargetNavigatorCurrentTarget() - : SubscribeAttribute("current-target") + SubscribeAttributeOccupancySensingOccupancySensorType() + : SubscribeAttribute("occupancy-sensor-type") { } - ~SubscribeAttributeTargetNavigatorCurrentTarget() {} + ~SubscribeAttributeOccupancySensingOccupancySensorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCurrentTargetWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOccupancySensorTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.OccupancySensorType response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52836,61 +57137,67 @@ class SubscribeAttributeTargetNavigatorCurrentTarget : public SubscribeAttribute }; /* - * Attribute GeneratedCommandList + * Attribute OccupancySensorTypeBitmap */ -class ReadTargetNavigatorGeneratedCommandList : public ReadAttribute { +class ReadOccupancySensingOccupancySensorTypeBitmap : public ReadAttribute { public: - ReadTargetNavigatorGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadOccupancySensingOccupancySensorTypeBitmap() + : ReadAttribute("occupancy-sensor-type-bitmap") { } - ~ReadTargetNavigatorGeneratedCommandList() {} + ~ReadOccupancySensingOccupancySensorTypeBitmap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.GeneratedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TargetNavigator GeneratedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing OccupancySensorTypeBitmap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeTargetNavigatorGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap : public SubscribeAttribute { public: - SubscribeAttributeTargetNavigatorGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap() + : SubscribeAttribute("occupancy-sensor-type-bitmap") { } - ~SubscribeAttributeTargetNavigatorGeneratedCommandList() {} + ~SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster + subscribeAttributeOccupancySensorTypeBitmapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.GeneratedCommandList response %@", + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -52907,30 +57214,33 @@ class SubscribeAttributeTargetNavigatorGeneratedCommandList : public SubscribeAt }; /* - * Attribute AcceptedCommandList + * Attribute PirOccupiedToUnoccupiedDelay */ -class ReadTargetNavigatorAcceptedCommandList : public ReadAttribute { +class ReadOccupancySensingPirOccupiedToUnoccupiedDelay : public ReadAttribute { public: - ReadTargetNavigatorAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadOccupancySensingPirOccupiedToUnoccupiedDelay() + : ReadAttribute("pir-occupied-to-unoccupied-delay") { } - ~ReadTargetNavigatorAcceptedCommandList() {} + ~ReadOccupancySensingPirOccupiedToUnoccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.AcceptedCommandList response %@", [value description]); + [cluster readAttributePirOccupiedToUnoccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PirOccupiedToUnoccupiedDelay response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TargetNavigator AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OccupancySensing PirOccupiedToUnoccupiedDelay read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -52938,35 +57248,81 @@ class ReadTargetNavigatorAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeTargetNavigatorAcceptedCommandList : public SubscribeAttribute { +class WriteOccupancySensingPirOccupiedToUnoccupiedDelay : public WriteAttribute { public: - SubscribeAttributeTargetNavigatorAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteOccupancySensingPirOccupiedToUnoccupiedDelay() + : WriteAttribute("pir-occupied-to-unoccupied-delay") { + AddArgument("attr-name", "pir-occupied-to-unoccupied-delay"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTargetNavigatorAcceptedCommandList() {} + ~WriteOccupancySensingPirOccupiedToUnoccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributePirOccupiedToUnoccupiedDelayWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing PirOccupiedToUnoccupiedDelay write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOccupancySensingPirOccupiedToUnoccupiedDelay : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingPirOccupiedToUnoccupiedDelay() + : SubscribeAttribute("pir-occupied-to-unoccupied-delay") + { + } + + ~SubscribeAttributeOccupancySensingPirOccupiedToUnoccupiedDelay() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.AcceptedCommandList response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributePirOccupiedToUnoccupiedDelayWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PirOccupiedToUnoccupiedDelay response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -52978,30 +57334,33 @@ class SubscribeAttributeTargetNavigatorAcceptedCommandList : public SubscribeAtt }; /* - * Attribute AttributeList + * Attribute PirUnoccupiedToOccupiedDelay */ -class ReadTargetNavigatorAttributeList : public ReadAttribute { +class ReadOccupancySensingPirUnoccupiedToOccupiedDelay : public ReadAttribute { public: - ReadTargetNavigatorAttributeList() - : ReadAttribute("attribute-list") + ReadOccupancySensingPirUnoccupiedToOccupiedDelay() + : ReadAttribute("pir-unoccupied-to-occupied-delay") { } - ~ReadTargetNavigatorAttributeList() {} + ~ReadOccupancySensingPirUnoccupiedToOccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.AttributeList response %@", [value description]); + [cluster readAttributePirUnoccupiedToOccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PirUnoccupiedToOccupiedDelay response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TargetNavigator AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OccupancySensing PirUnoccupiedToOccupiedDelay read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53009,34 +57368,81 @@ class ReadTargetNavigatorAttributeList : public ReadAttribute { } }; -class SubscribeAttributeTargetNavigatorAttributeList : public SubscribeAttribute { +class WriteOccupancySensingPirUnoccupiedToOccupiedDelay : public WriteAttribute { public: - SubscribeAttributeTargetNavigatorAttributeList() - : SubscribeAttribute("attribute-list") + WriteOccupancySensingPirUnoccupiedToOccupiedDelay() + : WriteAttribute("pir-unoccupied-to-occupied-delay") { + AddArgument("attr-name", "pir-unoccupied-to-occupied-delay"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTargetNavigatorAttributeList() {} + ~WriteOccupancySensingPirUnoccupiedToOccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributePirUnoccupiedToOccupiedDelayWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing PirUnoccupiedToOccupiedDelay write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOccupancySensingPirUnoccupiedToOccupiedDelay : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingPirUnoccupiedToOccupiedDelay() + : SubscribeAttribute("pir-unoccupied-to-occupied-delay") + { + } + + ~SubscribeAttributeOccupancySensingPirUnoccupiedToOccupiedDelay() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributePirUnoccupiedToOccupiedDelayWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PirUnoccupiedToOccupiedDelay response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53048,30 +57454,33 @@ class SubscribeAttributeTargetNavigatorAttributeList : public SubscribeAttribute }; /* - * Attribute ClusterRevision + * Attribute PirUnoccupiedToOccupiedThreshold */ -class ReadTargetNavigatorClusterRevision : public ReadAttribute { +class ReadOccupancySensingPirUnoccupiedToOccupiedThreshold : public ReadAttribute { public: - ReadTargetNavigatorClusterRevision() - : ReadAttribute("cluster-revision") + ReadOccupancySensingPirUnoccupiedToOccupiedThreshold() + : ReadAttribute("pir-unoccupied-to-occupied-threshold") { } - ~ReadTargetNavigatorClusterRevision() {} + ~ReadOccupancySensingPirUnoccupiedToOccupiedThreshold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); + [cluster readAttributePirUnoccupiedToOccupiedThresholdWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PirUnoccupiedToOccupiedThreshold response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TargetNavigator ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OccupancySensing PirUnoccupiedToOccupiedThreshold read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53079,34 +57488,84 @@ class ReadTargetNavigatorClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribute { +class WriteOccupancySensingPirUnoccupiedToOccupiedThreshold : public WriteAttribute { public: - SubscribeAttributeTargetNavigatorClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteOccupancySensingPirUnoccupiedToOccupiedThreshold() + : WriteAttribute("pir-unoccupied-to-occupied-threshold") { + AddArgument("attr-name", "pir-unoccupied-to-occupied-threshold"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTargetNavigatorClusterRevision() {} + ~WriteOccupancySensingPirUnoccupiedToOccupiedThreshold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributePirUnoccupiedToOccupiedThresholdWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing PirUnoccupiedToOccupiedThreshold write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeOccupancySensingPirUnoccupiedToOccupiedThreshold : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingPirUnoccupiedToOccupiedThreshold() + : SubscribeAttribute("pir-unoccupied-to-occupied-threshold") + { + } + + ~SubscribeAttributeOccupancySensingPirUnoccupiedToOccupiedThreshold() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePirUnoccupiedToOccupiedThresholdWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PirUnoccupiedToOccupiedThreshold " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53117,52 +57576,34 @@ class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribu } }; -/*----------------------------------------------------------------------------*\ -| Cluster TemperatureMeasurement | 0x0402 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Attribute MeasuredValue + * Attribute UltrasonicOccupiedToUnoccupiedDelay */ -class ReadTemperatureMeasurementMeasuredValue : public ReadAttribute { +class ReadOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public ReadAttribute { public: - ReadTemperatureMeasurementMeasuredValue() - : ReadAttribute("measured-value") + ReadOccupancySensingUltrasonicOccupiedToUnoccupiedDelay() + : ReadAttribute("ultrasonic-occupied-to-unoccupied-delay") { } - ~ReadTemperatureMeasurementMeasuredValue() {} + ~ReadOccupancySensingUltrasonicOccupiedToUnoccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); + [cluster readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.UltrasonicOccupiedToUnoccupiedDelay response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TemperatureMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OccupancySensing UltrasonicOccupiedToUnoccupiedDelay read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53170,37 +57611,85 @@ class ReadTemperatureMeasurementMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeTemperatureMeasurementMeasuredValue : public SubscribeAttribute { +class WriteOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public WriteAttribute { public: - SubscribeAttributeTemperatureMeasurementMeasuredValue() - : SubscribeAttribute("measured-value") + WriteOccupancySensingUltrasonicOccupiedToUnoccupiedDelay() + : WriteAttribute("ultrasonic-occupied-to-unoccupied-delay") { + AddArgument("attr-name", "ultrasonic-occupied-to-unoccupied-delay"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTemperatureMeasurementMeasuredValue() {} + ~WriteOccupancySensingUltrasonicOccupiedToUnoccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing UltrasonicOccupiedToUnoccupiedDelay write " + "Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingUltrasonicOccupiedToUnoccupiedDelay() + : SubscribeAttribute("ultrasonic-occupied-to-unoccupied-delay") + { + } + + ~SubscribeAttributeOccupancySensingUltrasonicOccupiedToUnoccupiedDelay() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeUltrasonicOccupiedToUnoccupiedDelayWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing." + @"UltrasonicOccupiedToUnoccupiedDelay response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53212,32 +57701,33 @@ class SubscribeAttributeTemperatureMeasurementMeasuredValue : public SubscribeAt }; /* - * Attribute MinMeasuredValue + * Attribute UltrasonicUnoccupiedToOccupiedDelay */ -class ReadTemperatureMeasurementMinMeasuredValue : public ReadAttribute { +class ReadOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public ReadAttribute { public: - ReadTemperatureMeasurementMinMeasuredValue() - : ReadAttribute("min-measured-value") + ReadOccupancySensingUltrasonicUnoccupiedToOccupiedDelay() + : ReadAttribute("ultrasonic-unoccupied-to-occupied-delay") { } - ~ReadTemperatureMeasurementMinMeasuredValue() {} + ~ReadOccupancySensingUltrasonicUnoccupiedToOccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", [value description]); + [cluster readAttributeUltrasonicUnoccupiedToOccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedDelay response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TemperatureMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "OccupancySensing UltrasonicUnoccupiedToOccupiedDelay read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53245,37 +57735,85 @@ class ReadTemperatureMeasurementMinMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeTemperatureMeasurementMinMeasuredValue : public SubscribeAttribute { +class WriteOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public WriteAttribute { public: - SubscribeAttributeTemperatureMeasurementMinMeasuredValue() - : SubscribeAttribute("min-measured-value") + WriteOccupancySensingUltrasonicUnoccupiedToOccupiedDelay() + : WriteAttribute("ultrasonic-unoccupied-to-occupied-delay") { + AddArgument("attr-name", "ultrasonic-unoccupied-to-occupied-delay"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTemperatureMeasurementMinMeasuredValue() {} + ~WriteOccupancySensingUltrasonicUnoccupiedToOccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing UltrasonicUnoccupiedToOccupiedDelay write " + "Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedDelay() + : SubscribeAttribute("ultrasonic-unoccupied-to-occupied-delay") + { + } + + ~SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedDelay() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000021) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeUltrasonicUnoccupiedToOccupiedDelayWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing." + @"UltrasonicUnoccupiedToOccupiedDelay response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53287,32 +57825,34 @@ class SubscribeAttributeTemperatureMeasurementMinMeasuredValue : public Subscrib }; /* - * Attribute MaxMeasuredValue + * Attribute UltrasonicUnoccupiedToOccupiedThreshold */ -class ReadTemperatureMeasurementMaxMeasuredValue : public ReadAttribute { +class ReadOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public ReadAttribute { public: - ReadTemperatureMeasurementMaxMeasuredValue() - : ReadAttribute("max-measured-value") + ReadOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold() + : ReadAttribute("ultrasonic-unoccupied-to-occupied-threshold") { } - ~ReadTemperatureMeasurementMaxMeasuredValue() {} + ~ReadOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", [value description]); + [cluster readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedThreshold response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TemperatureMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "OccupancySensing UltrasonicUnoccupiedToOccupiedThreshold read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53320,37 +57860,86 @@ class ReadTemperatureMeasurementMaxMeasuredValue : public ReadAttribute { } }; -class SubscribeAttributeTemperatureMeasurementMaxMeasuredValue : public SubscribeAttribute { +class WriteOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public WriteAttribute { public: - SubscribeAttributeTemperatureMeasurementMaxMeasuredValue() - : SubscribeAttribute("max-measured-value") + WriteOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold() + : WriteAttribute("ultrasonic-unoccupied-to-occupied-threshold") + { + AddArgument("attr-name", "ultrasonic-unoccupied-to-occupied-threshold"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000022) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing " + "UltrasonicUnoccupiedToOccupiedThreshold write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold() + : SubscribeAttribute("ultrasonic-unoccupied-to-occupied-threshold") { } - ~SubscribeAttributeTemperatureMeasurementMaxMeasuredValue() {} + ~SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing." + @"UltrasonicUnoccupiedToOccupiedThreshold " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53362,32 +57951,34 @@ class SubscribeAttributeTemperatureMeasurementMaxMeasuredValue : public Subscrib }; /* - * Attribute Tolerance + * Attribute PhysicalContactOccupiedToUnoccupiedDelay */ -class ReadTemperatureMeasurementTolerance : public ReadAttribute { +class ReadOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public ReadAttribute { public: - ReadTemperatureMeasurementTolerance() - : ReadAttribute("tolerance") + ReadOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay() + : ReadAttribute("physical-contact-occupied-to-unoccupied-delay") { } - ~ReadTemperatureMeasurementTolerance() {} + ~ReadOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); + [cluster readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PhysicalContactOccupiedToUnoccupiedDelay response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TemperatureMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "OccupancySensing PhysicalContactOccupiedToUnoccupiedDelay read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53395,36 +57986,87 @@ class ReadTemperatureMeasurementTolerance : public ReadAttribute { } }; -class SubscribeAttributeTemperatureMeasurementTolerance : public SubscribeAttribute { +class WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public WriteAttribute { public: - SubscribeAttributeTemperatureMeasurementTolerance() - : SubscribeAttribute("tolerance") + WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay() + : WriteAttribute("physical-contact-occupied-to-unoccupied-delay") { + AddArgument("attr-name", "physical-contact-occupied-to-unoccupied-delay"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTemperatureMeasurementTolerance() {} + ~WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing PhysicalContactOccupiedToUnoccupiedDelay " + "write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay() + : SubscribeAttribute("physical-contact-occupied-to-unoccupied-delay") + { + } + + ~SubscribeAttributeOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000030) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributePhysicalContactOccupiedToUnoccupiedDelayWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing." + @"PhysicalContactOccupiedToUnoccupiedDelay " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53436,32 +58078,34 @@ class SubscribeAttributeTemperatureMeasurementTolerance : public SubscribeAttrib }; /* - * Attribute AttributeList + * Attribute PhysicalContactUnoccupiedToOccupiedDelay */ -class ReadTemperatureMeasurementAttributeList : public ReadAttribute { +class ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public ReadAttribute { public: - ReadTemperatureMeasurementAttributeList() - : ReadAttribute("attribute-list") + ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay() + : ReadAttribute("physical-contact-unoccupied-to-occupied-delay") { } - ~ReadTemperatureMeasurementAttributeList() {} + ~ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); + [cluster readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedDelay response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TemperatureMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "OccupancySensing PhysicalContactUnoccupiedToOccupiedDelay read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53469,37 +58113,87 @@ class ReadTemperatureMeasurementAttributeList : public ReadAttribute { } }; -class SubscribeAttributeTemperatureMeasurementAttributeList : public SubscribeAttribute { +class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public WriteAttribute { public: - SubscribeAttributeTemperatureMeasurementAttributeList() - : SubscribeAttribute("attribute-list") + WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay() + : WriteAttribute("physical-contact-unoccupied-to-occupied-delay") { + AddArgument("attr-name", "physical-contact-unoccupied-to-occupied-delay"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTemperatureMeasurementAttributeList() {} + ~WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster + writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing PhysicalContactUnoccupiedToOccupiedDelay " + "write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay() + : SubscribeAttribute("physical-contact-unoccupied-to-occupied-delay") + { + } + + ~SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000031) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributePhysicalContactUnoccupiedToOccupiedDelayWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing." + @"PhysicalContactUnoccupiedToOccupiedDelay " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53511,32 +58205,34 @@ class SubscribeAttributeTemperatureMeasurementAttributeList : public SubscribeAt }; /* - * Attribute ClusterRevision + * Attribute PhysicalContactUnoccupiedToOccupiedThreshold */ -class ReadTemperatureMeasurementClusterRevision : public ReadAttribute { +class ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public ReadAttribute { public: - ReadTemperatureMeasurementClusterRevision() - : ReadAttribute("cluster-revision") + ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold() + : ReadAttribute("physical-contact-unoccupied-to-occupied-threshold") { } - ~ReadTemperatureMeasurementClusterRevision() {} + ~ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.ClusterRevision response %@", [value description]); + [cluster readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedThreshold response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TemperatureMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError( + chipTool, "OccupancySensing PhysicalContactUnoccupiedToOccupiedThreshold read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -53544,37 +58240,89 @@ class ReadTemperatureMeasurementClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeTemperatureMeasurementClusterRevision : public SubscribeAttribute { +class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public WriteAttribute { public: - SubscribeAttributeTemperatureMeasurementClusterRevision() - : SubscribeAttribute("cluster-revision") + WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold() + : WriteAttribute("physical-contact-unoccupied-to-occupied-threshold") { + AddArgument("attr-name", "physical-contact-unoccupied-to-occupied-threshold"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTemperatureMeasurementClusterRevision() {} + ~WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) WriteAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device - endpoint:endpointId - queue:callbackQueue]; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "OccupancySensing " + "PhysicalContactUnoccupiedToOccupiedThreshold write " + "Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold() + : SubscribeAttribute("physical-contact-unoccupied-to-occupied-threshold") + { + } + + ~SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000032) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TemperatureMeasurement.ClusterRevision response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithMinInterval:[NSNumber + numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber + numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, + NSError * _Nullable error) { + NSLog(@"OccupancySensing." + @"PhysicalContactUnoccupiedToOccupiedThreshol" + @"d response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -53585,211 +58333,430 @@ class SubscribeAttributeTemperatureMeasurementClusterRevision : public Subscribe } }; -/*----------------------------------------------------------------------------*\ -| Cluster TestCluster | 0x050F | -|------------------------------------------------------------------------------| -| Commands: | | -| * Test | 0x00 | -| * TestNotHandled | 0x01 | -| * TestSpecific | 0x02 | -| * TestUnknownCommand | 0x03 | -| * TestAddArguments | 0x04 | -| * TestSimpleArgumentRequest | 0x05 | -| * TestStructArrayArgumentRequest | 0x06 | -| * TestStructArgumentRequest | 0x07 | -| * TestNestedStructArgumentRequest | 0x08 | -| * TestListStructArgumentRequest | 0x09 | -| * TestListInt8UArgumentRequest | 0x0A | -| * TestNestedStructListArgumentRequest | 0x0B | -| * TestListNestedStructListArgumentRequest | 0x0C | -| * TestListInt8UReverseRequest | 0x0D | -| * TestEnumsRequest | 0x0E | -| * TestNullableOptionalRequest | 0x0F | -| * TestComplexNullableOptionalRequest | 0x10 | -| * SimpleStructEchoRequest | 0x11 | -| * TimedInvokeRequest | 0x12 | -| * TestSimpleOptionalArgumentRequest | 0x13 | -| * TestEmitTestEventRequest | 0x14 | -| * TestEmitTestFabricScopedEventRequest | 0x15 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Boolean | 0x0000 | -| * Bitmap8 | 0x0001 | -| * Bitmap16 | 0x0002 | -| * Bitmap32 | 0x0003 | -| * Bitmap64 | 0x0004 | -| * Int8u | 0x0005 | -| * Int16u | 0x0006 | -| * Int24u | 0x0007 | -| * Int32u | 0x0008 | -| * Int40u | 0x0009 | -| * Int48u | 0x000A | -| * Int56u | 0x000B | -| * Int64u | 0x000C | -| * Int8s | 0x000D | -| * Int16s | 0x000E | -| * Int24s | 0x000F | -| * Int32s | 0x0010 | -| * Int40s | 0x0011 | -| * Int48s | 0x0012 | -| * Int56s | 0x0013 | -| * Int64s | 0x0014 | -| * Enum8 | 0x0015 | -| * Enum16 | 0x0016 | -| * FloatSingle | 0x0017 | -| * FloatDouble | 0x0018 | -| * OctetString | 0x0019 | -| * ListInt8u | 0x001A | -| * ListOctetString | 0x001B | -| * ListStructOctetString | 0x001C | -| * LongOctetString | 0x001D | -| * CharString | 0x001E | -| * LongCharString | 0x001F | -| * EpochUs | 0x0020 | -| * EpochS | 0x0021 | -| * VendorId | 0x0022 | -| * ListNullablesAndOptionalsStruct | 0x0023 | -| * EnumAttr | 0x0024 | -| * StructAttr | 0x0025 | -| * RangeRestrictedInt8u | 0x0026 | -| * RangeRestrictedInt8s | 0x0027 | -| * RangeRestrictedInt16u | 0x0028 | -| * RangeRestrictedInt16s | 0x0029 | -| * ListLongOctetString | 0x002A | -| * ListFabricScoped | 0x002B | -| * TimedWriteBoolean | 0x0030 | -| * GeneralErrorBoolean | 0x0031 | -| * ClusterErrorBoolean | 0x0032 | -| * Unsupported | 0x00FF | -| * NullableBoolean | 0x4000 | -| * NullableBitmap8 | 0x4001 | -| * NullableBitmap16 | 0x4002 | -| * NullableBitmap32 | 0x4003 | -| * NullableBitmap64 | 0x4004 | -| * NullableInt8u | 0x4005 | -| * NullableInt16u | 0x4006 | -| * NullableInt24u | 0x4007 | -| * NullableInt32u | 0x4008 | -| * NullableInt40u | 0x4009 | -| * NullableInt48u | 0x400A | -| * NullableInt56u | 0x400B | -| * NullableInt64u | 0x400C | -| * NullableInt8s | 0x400D | -| * NullableInt16s | 0x400E | -| * NullableInt24s | 0x400F | -| * NullableInt32s | 0x4010 | -| * NullableInt40s | 0x4011 | -| * NullableInt48s | 0x4012 | -| * NullableInt56s | 0x4013 | -| * NullableInt64s | 0x4014 | -| * NullableEnum8 | 0x4015 | -| * NullableEnum16 | 0x4016 | -| * NullableFloatSingle | 0x4017 | -| * NullableFloatDouble | 0x4018 | -| * NullableOctetString | 0x4019 | -| * NullableCharString | 0x401E | -| * NullableEnumAttr | 0x4024 | -| * NullableStruct | 0x4025 | -| * NullableRangeRestrictedInt8u | 0x4026 | -| * NullableRangeRestrictedInt8s | 0x4027 | -| * NullableRangeRestrictedInt16u | 0x4028 | -| * NullableRangeRestrictedInt16s | 0x4029 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * TestEvent | 0x0001 | -| * TestFabricScopedEvent | 0x0002 | -\*----------------------------------------------------------------------------*/ - /* - * Command SimpleStructEchoRequest + * Attribute GeneratedCommandList */ -class TestClusterSimpleStructEchoRequest : public ClusterCommand { +class ReadOccupancySensingGeneratedCommandList : public ReadAttribute { public: - TestClusterSimpleStructEchoRequest() - : ClusterCommand("simple-struct-echo-request") - , mComplex_Arg1(&mRequest.arg1) + ReadOccupancySensingGeneratedCommandList() + : ReadAttribute("generated-command-list") { - AddArgument("Arg1", &mComplex_Arg1); - ClusterCommand::AddArguments(); } + ~ReadOccupancySensingGeneratedCommandList() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [CHIPTestClusterClusterSimpleStruct new]; - params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; - params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; - params.arg1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c)]; - params.arg1.d = [NSData dataWithBytes:mRequest.arg1.d.data() length:mRequest.arg1.d.size()]; - params.arg1.e = [[NSString alloc] initWithBytes:mRequest.arg1.e.data() - length:mRequest.arg1.e.size() - encoding:NSUTF8StringEncoding]; - params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()]; - params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g]; - params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster simpleStructEchoRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } - -private: - chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOccupancySensingGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeOccupancySensingGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command Test + * Attribute AcceptedCommandList */ -class TestClusterTest : public ClusterCommand { +class ReadOccupancySensingAcceptedCommandList : public ReadAttribute { public: - TestClusterTest() - : ClusterCommand("test") + ReadOccupancySensingAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadOccupancySensingAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOccupancySensingAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeOccupancySensingAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadOccupancySensingAttributeList : public ReadAttribute { +public: + ReadOccupancySensingAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadOccupancySensingAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOccupancySensingAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeOccupancySensingAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadOccupancySensingFeatureMap : public ReadAttribute { +public: + ReadOccupancySensingFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadOccupancySensingFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOccupancySensingFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeOccupancySensingFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadOccupancySensingClusterRevision : public ReadAttribute { +public: + ReadOccupancySensingClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadOccupancySensingClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OccupancySensing ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOccupancySensingClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeOccupancySensingClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeOccupancySensingClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster OnOff | 0x0006 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Off | 0x00 | +| * On | 0x01 | +| * Toggle | 0x02 | +| * OffWithEffect | 0x40 | +| * OnWithRecallGlobalScene | 0x41 | +| * OnWithTimedOff | 0x42 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * OnOff | 0x0000 | +| * GlobalSceneControl | 0x4000 | +| * OnTime | 0x4001 | +| * OffWaitTime | 0x4002 | +| * StartUpOnOff | 0x4003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command Off + */ +class OnOffOff : public ClusterCommand { +public: + OnOffOff() + : ClusterCommand("off") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestParams alloc] init]; + __auto_type * params = [[CHIPOnOffClusterOffParams 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 testWithCompletionHandler:^(NSError * _Nullable error) { + [cluster offWithCompletionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; if (chipError != CHIP_NO_ERROR) { @@ -53805,571 +58772,15053 @@ class TestClusterTest : public ClusterCommand { } private: + chip::app::Clusters::OnOff::Commands::Off::Type mRequest; }; /* - * Command TestAddArguments + * Command On */ -class TestClusterTestAddArguments : public ClusterCommand { +class OnOffOn : public ClusterCommand { public: - TestClusterTestAddArguments() - : ClusterCommand("test-add-arguments") + OnOffOn() + : ClusterCommand("on") { - AddArgument("Arg1", 0, UINT8_MAX, &mArg1); - AddArgument("Arg2", 0, UINT8_MAX, &mArg2); + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + __auto_type * params = [[CHIPOnOffClusterOnParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; - params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testAddArgumentsWithParams:params - completionHandler:^(CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster onWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mArg1; - uint8_t mArg2; + chip::app::Clusters::OnOff::Commands::On::Type mRequest; }; /* - * Command TestEmitTestEventRequest + * Command Toggle */ -class TestClusterTestEmitTestEventRequest : public ClusterCommand { +class OnOffToggle : public ClusterCommand { public: - TestClusterTestEmitTestEventRequest() - : ClusterCommand("test-emit-test-event-request") + OnOffToggle() + : ClusterCommand("toggle") { - AddArgument("Arg1", 0, UINT8_MAX, &mArg1); - AddArgument("Arg2", 0, UINT8_MAX, &mArg2); - AddArgument("Arg3", 0, 1, &mArg3); + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestEmitTestEventRequestParams alloc] init]; + __auto_type * params = [[CHIPOnOffClusterToggleParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; - params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; - params.arg3 = [NSNumber numberWithBool:mArg3]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testEmitTestEventRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestEmitTestEventResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster toggleWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - uint8_t mArg1; - uint8_t mArg2; - bool mArg3; + chip::app::Clusters::OnOff::Commands::Toggle::Type mRequest; }; /* - * Command TestEnumsRequest + * Command OffWithEffect */ -class TestClusterTestEnumsRequest : public ClusterCommand { +class OnOffOffWithEffect : public ClusterCommand { public: - TestClusterTestEnumsRequest() - : ClusterCommand("test-enums-request") + OnOffOffWithEffect() + : ClusterCommand("off-with-effect") { - AddArgument("Arg1", 0, UINT16_MAX, &mArg1); - AddArgument("Arg2", 0, UINT8_MAX, &mArg2); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("EffectId", 0, UINT8_MAX, &mEffectId); + AddArgument("EffectVariant", 0, UINT8_MAX, &mEffectVariant); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; + __auto_type * params = [[CHIPOnOffClusterOffWithEffectParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithUnsignedShort:mArg1]; - params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; + params.effectId = [NSNumber numberWithUnsignedChar:mEffectId]; + params.effectVariant = [NSNumber numberWithUnsignedChar:mEffectVariant]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testEnumsRequestWithParams:params - completionHandler:^( - CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster offWithEffectWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::VendorId mArg1; - uint8_t mArg2; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type mRequest; + uint8_t mEffectId; + uint8_t mEffectVariant; }; /* - * Command TestListInt8UArgumentRequest + * Command OnWithRecallGlobalScene */ -class TestClusterTestListInt8UArgumentRequest : public ClusterCommand { +class OnOffOnWithRecallGlobalScene : public ClusterCommand { public: - TestClusterTestListInt8UArgumentRequest() - : ClusterCommand("test-list-int8uargument-request") - , mComplex_Arg1(&mRequest.arg1) + OnOffOnWithRecallGlobalScene() + : ClusterCommand("on-with-recall-global-scene") { - AddArgument("Arg1", &mComplex_Arg1); + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; + __auto_type * params = [[CHIPOnOffClusterOnWithRecallGlobalSceneParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.arg1) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - params.arg1 = array_0; - } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testListInt8UArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster onWithRecallGlobalSceneWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type mRequest; - TypedComplexArgument> mComplex_Arg1; + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type mRequest; }; /* - * Command TestListInt8UReverseRequest + * Command OnWithTimedOff */ -class TestClusterTestListInt8UReverseRequest : public ClusterCommand { +class OnOffOnWithTimedOff : public ClusterCommand { public: - TestClusterTestListInt8UReverseRequest() - : ClusterCommand("test-list-int8ureverse-request") - , mComplex_Arg1(&mRequest.arg1) + OnOffOnWithTimedOff() + : ClusterCommand("on-with-timed-off") { - AddArgument("Arg1", &mComplex_Arg1); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("OnOffControl", 0, UINT8_MAX, &mOnOffControl); + AddArgument("OnTime", 0, UINT16_MAX, &mOnTime); + AddArgument("OffWaitTime", 0, UINT16_MAX, &mOffWaitTime); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; + __auto_type * params = [[CHIPOnOffClusterOnWithTimedOffParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.arg1) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - params.arg1 = array_0; - } + params.onOffControl = [NSNumber numberWithUnsignedChar:mOnOffControl]; + params.onTime = [NSNumber numberWithUnsignedShort:mOnTime]; + params.offWaitTime = [NSNumber numberWithUnsignedShort:mOffWaitTime]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster - testListInt8UReverseRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster onWithTimedOffWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type mRequest; - TypedComplexArgument> mComplex_Arg1; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type mRequest; + uint8_t mOnOffControl; + uint16_t mOnTime; + uint16_t mOffWaitTime; }; /* - * Command TestListNestedStructListArgumentRequest + * Attribute OnOff */ -class TestClusterTestListNestedStructListArgumentRequest : public ClusterCommand { +class ReadOnOffOnOff : public ReadAttribute { public: - TestClusterTestListNestedStructListArgumentRequest() - : ClusterCommand("test-list-nested-struct-list-argument-request") - , mComplex_Arg1(&mRequest.arg1) + ReadOnOffOnOff() + : ReadAttribute("on-off") { - AddArgument("Arg1", &mComplex_Arg1); - ClusterCommand::AddArguments(); } + ~ReadOnOffOnOff() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.arg1) { - CHIPTestClusterClusterNestedStructList * newElement_0; - newElement_0 = [CHIPTestClusterClusterNestedStructList new]; - newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; - newElement_0.b = [NSNumber numberWithBool:entry_0.b]; - newElement_0.c = [CHIPTestClusterClusterSimpleStruct new]; - newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; - newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; - newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; - newElement_0.c.d = [NSData dataWithBytes:entry_0.c.d.data() length:entry_0.c.d.size()]; - newElement_0.c.e = [[NSString alloc] initWithBytes:entry_0.c.e.data() - length:entry_0.c.e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; - newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; - newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - for (auto & entry_2 : entry_0.d) { - CHIPTestClusterClusterSimpleStruct * newElement_2; - newElement_2 = [CHIPTestClusterClusterSimpleStruct new]; - newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; - newElement_2.b = [NSNumber numberWithBool:entry_2.b]; - newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; - newElement_2.d = [NSData dataWithBytes:entry_2.d.data() length:entry_2.d.size()]; - newElement_2.e = [[NSString alloc] initWithBytes:entry_2.e.data() - length:entry_2.e.size() - encoding:NSUTF8StringEncoding]; - newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; - newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; - newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; - [array_2 addObject:newElement_2]; - } - newElement_0.d = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - for (auto & entry_2 : entry_0.e) { - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; - [array_2 addObject:newElement_2]; - } - newElement_0.e = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - for (auto & entry_2 : entry_0.f) { - NSData * newElement_2; - newElement_2 = [NSData dataWithBytes:entry_2.data() length:entry_2.size()]; - [array_2 addObject:newElement_2]; - } - newElement_0.f = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - for (auto & entry_2 : entry_0.g) { - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; - [array_2 addObject:newElement_2]; - } - newElement_0.g = array_2; - } - [array_0 addObject:newElement_0]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.OnOff response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff OnOff read Error: %s", chip::ErrorStr(err)); } - params.arg1 = array_0; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - testListNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + SetCommandExitStatus(err); + }]; + return err; } +}; -private: - chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type mRequest; - TypedComplexArgument> - mComplex_Arg1; +class SubscribeAttributeOnOffOnOff : public SubscribeAttribute { +public: + SubscribeAttributeOnOffOnOff() + : SubscribeAttribute("on-off") + { + } + + ~SubscribeAttributeOnOffOnOff() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.OnOff response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command TestListStructArgumentRequest + * Attribute GlobalSceneControl */ -class TestClusterTestListStructArgumentRequest : public ClusterCommand { +class ReadOnOffGlobalSceneControl : public ReadAttribute { public: - TestClusterTestListStructArgumentRequest() - : ClusterCommand("test-list-struct-argument-request") - , mComplex_Arg1(&mRequest.arg1) + ReadOnOffGlobalSceneControl() + : ReadAttribute("global-scene-control") { - AddArgument("Arg1", &mComplex_Arg1); - ClusterCommand::AddArguments(); } + ~ReadOnOffGlobalSceneControl() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.arg1) { - CHIPTestClusterClusterSimpleStruct * newElement_0; - newElement_0 = [CHIPTestClusterClusterSimpleStruct new]; - newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; - newElement_0.b = [NSNumber numberWithBool:entry_0.b]; - newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; - newElement_0.d = [NSData dataWithBytes:entry_0.d.data() length:entry_0.d.size()]; - newElement_0.e = [[NSString alloc] initWithBytes:entry_0.e.data() - length:entry_0.e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; - newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; - newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; - [array_0 addObject:newElement_0]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff GlobalSceneControl read Error: %s", chip::ErrorStr(err)); } - params.arg1 = array_0; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testListStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + SetCommandExitStatus(err); + }]; + return err; } - -private: - chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type mRequest; - TypedComplexArgument> - mComplex_Arg1; }; -/* - * Command TestNestedStructArgumentRequest - */ -class TestClusterTestNestedStructArgumentRequest : public ClusterCommand { +class SubscribeAttributeOnOffGlobalSceneControl : public SubscribeAttribute { public: - TestClusterTestNestedStructArgumentRequest() - : ClusterCommand("test-nested-struct-argument-request") - , mComplex_Arg1(&mRequest.arg1) + SubscribeAttributeOnOffGlobalSceneControl() + : SubscribeAttribute("global-scene-control") { - AddArgument("Arg1", &mComplex_Arg1); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeOnOffGlobalSceneControl() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000008) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [CHIPTestClusterClusterNestedStruct new]; - params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; - params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; - params.arg1.c = [CHIPTestClusterClusterSimpleStruct new]; - params.arg1.c.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.a]; - params.arg1.c.b = [NSNumber numberWithBool:mRequest.arg1.c.b]; - params.arg1.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.c)]; - params.arg1.c.d = [NSData dataWithBytes:mRequest.arg1.c.d.data() length:mRequest.arg1.c.d.size()]; - params.arg1.c.e = [[NSString alloc] initWithBytes:mRequest.arg1.c.e.data() - length:mRequest.arg1.c.e.size() - encoding:NSUTF8StringEncoding]; - params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()]; - params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g]; - params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testNestedStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGlobalSceneControlWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command TestNestedStructListArgumentRequest + * Attribute OnTime */ -class TestClusterTestNestedStructListArgumentRequest : public ClusterCommand { +class ReadOnOffOnTime : public ReadAttribute { public: - TestClusterTestNestedStructListArgumentRequest() - : ClusterCommand("test-nested-struct-list-argument-request") - , mComplex_Arg1(&mRequest.arg1) + ReadOnOffOnTime() + : ReadAttribute("on-time") { - AddArgument("Arg1", &mComplex_Arg1); - ClusterCommand::AddArguments(); } + ~ReadOnOffOnTime() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.OnTime response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff OnTime read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteOnOffOnTime : public WriteAttribute { +public: + WriteOnOffOnTime() + : WriteAttribute("on-time") + { + AddArgument("attr-name", "on-time"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteOnOffOnTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [CHIPTestClusterClusterNestedStructList new]; - params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; - params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; - params.arg1.c = [CHIPTestClusterClusterSimpleStruct new]; - params.arg1.c.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.a]; - params.arg1.c.b = [NSNumber numberWithBool:mRequest.arg1.c.b]; - params.arg1.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.c)]; - params.arg1.c.d = [NSData dataWithBytes:mRequest.arg1.c.d.data() length:mRequest.arg1.c.d.size()]; - params.arg1.c.e = [[NSString alloc] initWithBytes:mRequest.arg1.c.e.data() - length:mRequest.arg1.c.e.size() - encoding:NSUTF8StringEncoding]; - params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()]; - params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g]; - params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h]; - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeOnTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "OnOff OnTime write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOnOffOnTime : public SubscribeAttribute { +public: + SubscribeAttributeOnOffOnTime() + : SubscribeAttribute("on-time") + { + } + + ~SubscribeAttributeOnOffOnTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeOnTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.OnTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute OffWaitTime + */ +class ReadOnOffOffWaitTime : public ReadAttribute { +public: + ReadOnOffOffWaitTime() + : ReadAttribute("off-wait-time") + { + } + + ~ReadOnOffOffWaitTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.OffWaitTime response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff OffWaitTime read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteOnOffOffWaitTime : public WriteAttribute { +public: + WriteOnOffOffWaitTime() + : WriteAttribute("off-wait-time") + { + AddArgument("attr-name", "off-wait-time"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteOnOffOffWaitTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeOffWaitTimeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "OnOff OffWaitTime write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeOnOffOffWaitTime : public SubscribeAttribute { +public: + SubscribeAttributeOnOffOffWaitTime() + : SubscribeAttribute("off-wait-time") + { + } + + ~SubscribeAttributeOnOffOffWaitTime() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeOffWaitTimeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.OffWaitTime response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute StartUpOnOff + */ +class ReadOnOffStartUpOnOff : public ReadAttribute { +public: + ReadOnOffStartUpOnOff() + : ReadAttribute("start-up-on-off") + { + } + + ~ReadOnOffStartUpOnOff() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.StartUpOnOff response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff StartUpOnOff read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteOnOffStartUpOnOff : public WriteAttribute { +public: + WriteOnOffStartUpOnOff() + : WriteAttribute("start-up-on-off") + { + AddArgument("attr-name", "start-up-on-off"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteOnOffStartUpOnOff() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeStartUpOnOffWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "OnOff StartUpOnOff write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { +public: + SubscribeAttributeOnOffStartUpOnOff() + : SubscribeAttribute("start-up-on-off") + { + } + + ~SubscribeAttributeOnOffStartUpOnOff() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeStartUpOnOffWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.StartUpOnOff response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadOnOffGeneratedCommandList : public ReadAttribute { +public: + ReadOnOffGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadOnOffGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOnOffGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeOnOffGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadOnOffAcceptedCommandList : public ReadAttribute { +public: + ReadOnOffAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadOnOffAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOnOffAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeOnOffAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadOnOffAttributeList : public ReadAttribute { +public: + ReadOnOffAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadOnOffAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeOnOffAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeOnOffAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadOnOffFeatureMap : public ReadAttribute { +public: + ReadOnOffFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadOnOffFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeOnOffFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeOnOffFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadOnOffClusterRevision : public ReadAttribute { +public: + ReadOnOffClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadOnOffClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOff ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeOnOffClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeOnOffClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOff.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster OnOffSwitchConfiguration | 0x0007 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SwitchType | 0x0000 | +| * SwitchActions | 0x0010 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute SwitchType + */ +class ReadOnOffSwitchConfigurationSwitchType : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationSwitchType() + : ReadAttribute("switch-type") + { + } + + ~ReadOnOffSwitchConfigurationSwitchType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSwitchTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchType read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffSwitchConfigurationSwitchType : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationSwitchType() + : SubscribeAttribute("switch-type") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationSwitchType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSwitchTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute SwitchActions + */ +class ReadOnOffSwitchConfigurationSwitchActions : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationSwitchActions() + : ReadAttribute("switch-actions") + { + } + + ~ReadOnOffSwitchConfigurationSwitchActions() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSwitchActionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchActions read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteOnOffSwitchConfigurationSwitchActions : public WriteAttribute { +public: + WriteOnOffSwitchConfigurationSwitchActions() + : WriteAttribute("switch-actions") + { + AddArgument("attr-name", "switch-actions"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteOnOffSwitchConfigurationSwitchActions() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) WriteAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSwitchActionsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchActions write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeOnOffSwitchConfigurationSwitchActions : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationSwitchActions() + : SubscribeAttribute("switch-actions") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationSwitchActions() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeSwitchActionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadOnOffSwitchConfigurationGeneratedCommandList : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadOnOffSwitchConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadOnOffSwitchConfigurationAcceptedCommandList : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadOnOffSwitchConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadOnOffSwitchConfigurationAttributeList : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadOnOffSwitchConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffSwitchConfigurationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadOnOffSwitchConfigurationFeatureMap : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadOnOffSwitchConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffSwitchConfigurationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadOnOffSwitchConfigurationClusterRevision : public ReadAttribute { +public: + ReadOnOffSwitchConfigurationClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadOnOffSwitchConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OnOffSwitchConfiguration ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOnOffSwitchConfigurationClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeOnOffSwitchConfigurationClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeOnOffSwitchConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster OperationalCredentials | 0x003E | +|------------------------------------------------------------------------------| +| Commands: | | +| * AttestationRequest | 0x00 | +| * CertificateChainRequest | 0x02 | +| * CSRRequest | 0x04 | +| * AddNOC | 0x06 | +| * UpdateNOC | 0x07 | +| * UpdateFabricLabel | 0x09 | +| * RemoveFabric | 0x0A | +| * AddTrustedRootCertificate | 0x0B | +| * RemoveTrustedRootCertificate | 0x0C | +|------------------------------------------------------------------------------| +| Attributes: | | +| * NOCs | 0x0000 | +| * Fabrics | 0x0001 | +| * SupportedFabrics | 0x0002 | +| * CommissionedFabrics | 0x0003 | +| * TrustedRootCertificates | 0x0004 | +| * CurrentFabricIndex | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command AttestationRequest + */ +class OperationalCredentialsAttestationRequest : public ClusterCommand { +public: + OperationalCredentialsAttestationRequest() + : ClusterCommand("attestation-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("AttestationNonce", &mAttestationNonce); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterAttestationRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.attestationNonce = [[NSData alloc] initWithBytes:mAttestationNonce.data() length:mAttestationNonce.size()]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster attestationRequestWithParams:params + completionHandler:^(CHIPOperationalCredentialsClusterAttestationResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type mRequest; + chip::ByteSpan mAttestationNonce; +}; + +/* + * Command CertificateChainRequest + */ +class OperationalCredentialsCertificateChainRequest : public ClusterCommand { +public: + OperationalCredentialsCertificateChainRequest() + : ClusterCommand("certificate-chain-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("CertificateType", 0, UINT8_MAX, &mCertificateType); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterCertificateChainRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.certificateType = [NSNumber numberWithUnsignedChar:mCertificateType]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster certificateChainRequestWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterCertificateChainResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type mRequest; + uint8_t mCertificateType; +}; + +/* + * Command CSRRequest + */ +class OperationalCredentialsCSRRequest : public ClusterCommand { +public: + OperationalCredentialsCSRRequest() + : ClusterCommand("csrrequest") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("CSRNonce", &mCSRNonce); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterCSRRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.csrNonce = [[NSData alloc] initWithBytes:mCSRNonce.data() length:mCSRNonce.size()]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster CSRRequestWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterCSRResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::CSRRequest::Type mRequest; + chip::ByteSpan mCSRNonce; +}; + +/* + * Command AddNOC + */ +class OperationalCredentialsAddNOC : public ClusterCommand { +public: + OperationalCredentialsAddNOC() + : ClusterCommand("add-noc") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NOCValue", &mNOCValue); + AddArgument("ICACValue", &mICACValue); + AddArgument("IPKValue", &mIPKValue); + AddArgument("CaseAdminNode", 0, UINT64_MAX, &mCaseAdminNode); + AddArgument("AdminVendorId", 0, UINT16_MAX, &mAdminVendorId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterAddNOCParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; + if (mICACValue.HasValue()) { + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; + } + params.ipkValue = [[NSData alloc] initWithBytes:mIPKValue.data() length:mIPKValue.size()]; + params.caseAdminNode = [NSNumber numberWithUnsignedLongLong:mCaseAdminNode]; + params.adminVendorId = [NSNumber numberWithUnsignedShort:mAdminVendorId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addNOCWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type mRequest; + chip::ByteSpan mNOCValue; + chip::Optional mICACValue; + chip::ByteSpan mIPKValue; + chip::NodeId mCaseAdminNode; + uint16_t mAdminVendorId; +}; + +/* + * Command UpdateNOC + */ +class OperationalCredentialsUpdateNOC : public ClusterCommand { +public: + OperationalCredentialsUpdateNOC() + : ClusterCommand("update-noc") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NOCValue", &mNOCValue); + AddArgument("ICACValue", &mICACValue); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateNOCParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; + if (mICACValue.HasValue()) { + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster updateNOCWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type mRequest; + chip::ByteSpan mNOCValue; + chip::Optional mICACValue; +}; + +/* + * Command UpdateFabricLabel + */ +class OperationalCredentialsUpdateFabricLabel : public ClusterCommand { +public: + OperationalCredentialsUpdateFabricLabel() + : ClusterCommand("update-fabric-label") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Label", &mLabel); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.label = [[NSString alloc] initWithBytes:mLabel.data() length:mLabel.size() encoding:NSUTF8StringEncoding]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster updateFabricLabelWithParams:params + completionHandler:^(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type mRequest; + chip::ByteSpan mLabel; +}; + +/* + * Command RemoveFabric + */ +class OperationalCredentialsRemoveFabric : public ClusterCommand { +public: + OperationalCredentialsRemoveFabric() + : ClusterCommand("remove-fabric") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("FabricIndex", 0, UINT8_MAX, &mFabricIndex); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.fabricIndex = [NSNumber numberWithUnsignedChar:mFabricIndex]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster removeFabricWithParams:params + completionHandler:^( + CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type mRequest; + chip::FabricIndex mFabricIndex; +}; + +/* + * Command AddTrustedRootCertificate + */ +class OperationalCredentialsAddTrustedRootCertificate : public ClusterCommand { +public: + OperationalCredentialsAddTrustedRootCertificate() + : ClusterCommand("add-trusted-root-certificate") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("RootCertificate", &mRootCertificate); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterAddTrustedRootCertificateParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.rootCertificate = [[NSData alloc] initWithBytes:mRootCertificate.data() length:mRootCertificate.size()]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addTrustedRootCertificateWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type mRequest; + chip::ByteSpan mRootCertificate; +}; + +/* + * Command RemoveTrustedRootCertificate + */ +class OperationalCredentialsRemoveTrustedRootCertificate : public ClusterCommand { +public: + OperationalCredentialsRemoveTrustedRootCertificate() + : ClusterCommand("remove-trusted-root-certificate") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("TrustedRootIdentifier", &mTrustedRootIdentifier); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveTrustedRootCertificateParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.trustedRootIdentifier = [[NSData alloc] initWithBytes:mTrustedRootIdentifier.data() + length:mTrustedRootIdentifier.size()]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster removeTrustedRootCertificateWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type mRequest; + chip::ByteSpan mTrustedRootIdentifier; +}; + +/* + * Attribute NOCs + */ +class ReadOperationalCredentialsNOCs : public ReadAttribute { +public: + ReadOperationalCredentialsNOCs() + : ReadAttribute("nocs") + { + } + + ~ReadOperationalCredentialsNOCs() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster readAttributeNOCsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.NOCs response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials NOCs read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsNOCs : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsNOCs() + : SubscribeAttribute("nocs") + { + } + + ~SubscribeAttributeOperationalCredentialsNOCs() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeNOCsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.NOCs response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Fabrics + */ +class ReadOperationalCredentialsFabrics : public ReadAttribute { +public: + ReadOperationalCredentialsFabrics() + : ReadAttribute("fabrics") + { + } + + ~ReadOperationalCredentialsFabrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster readAttributeFabricsWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials Fabrics read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsFabrics : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsFabrics() + : SubscribeAttribute("fabrics") + { + } + + ~SubscribeAttributeOperationalCredentialsFabrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute SupportedFabrics + */ +class ReadOperationalCredentialsSupportedFabrics : public ReadAttribute { +public: + ReadOperationalCredentialsSupportedFabrics() + : ReadAttribute("supported-fabrics") + { + } + + ~ReadOperationalCredentialsSupportedFabrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.SupportedFabrics response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials SupportedFabrics read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsSupportedFabrics : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsSupportedFabrics() + : SubscribeAttribute("supported-fabrics") + { + } + + ~SubscribeAttributeOperationalCredentialsSupportedFabrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSupportedFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.SupportedFabrics response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CommissionedFabrics + */ +class ReadOperationalCredentialsCommissionedFabrics : public ReadAttribute { +public: + ReadOperationalCredentialsCommissionedFabrics() + : ReadAttribute("commissioned-fabrics") + { + } + + ~ReadOperationalCredentialsCommissionedFabrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.CommissionedFabrics response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials CommissionedFabrics read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsCommissionedFabrics : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsCommissionedFabrics() + : SubscribeAttribute("commissioned-fabrics") + { + } + + ~SubscribeAttributeOperationalCredentialsCommissionedFabrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCommissionedFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.CommissionedFabrics response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute TrustedRootCertificates + */ +class ReadOperationalCredentialsTrustedRootCertificates : public ReadAttribute { +public: + ReadOperationalCredentialsTrustedRootCertificates() + : ReadAttribute("trusted-root-certificates") + { + } + + ~ReadOperationalCredentialsTrustedRootCertificates() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeTrustedRootCertificatesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials TrustedRootCertificates read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsTrustedRootCertificates : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsTrustedRootCertificates() + : SubscribeAttribute("trusted-root-certificates") + { + } + + ~SubscribeAttributeOperationalCredentialsTrustedRootCertificates() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeTrustedRootCertificatesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentFabricIndex + */ +class ReadOperationalCredentialsCurrentFabricIndex : public ReadAttribute { +public: + ReadOperationalCredentialsCurrentFabricIndex() + : ReadAttribute("current-fabric-index") + { + } + + ~ReadOperationalCredentialsCurrentFabricIndex() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials CurrentFabricIndex read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsCurrentFabricIndex : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsCurrentFabricIndex() + : SubscribeAttribute("current-fabric-index") + { + } + + ~SubscribeAttributeOperationalCredentialsCurrentFabricIndex() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCurrentFabricIndexWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadOperationalCredentialsGeneratedCommandList : public ReadAttribute { +public: + ReadOperationalCredentialsGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadOperationalCredentialsGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeOperationalCredentialsGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadOperationalCredentialsAcceptedCommandList : public ReadAttribute { +public: + ReadOperationalCredentialsAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadOperationalCredentialsAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeOperationalCredentialsAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadOperationalCredentialsAttributeList : public ReadAttribute { +public: + ReadOperationalCredentialsAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadOperationalCredentialsAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeOperationalCredentialsAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadOperationalCredentialsFeatureMap : public ReadAttribute { +public: + ReadOperationalCredentialsFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadOperationalCredentialsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeOperationalCredentialsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadOperationalCredentialsClusterRevision : public ReadAttribute { +public: + ReadOperationalCredentialsClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadOperationalCredentialsClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "OperationalCredentials ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeOperationalCredentialsClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeOperationalCredentialsClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeOperationalCredentialsClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster PowerSource | 0x002F | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Status | 0x0000 | +| * Order | 0x0001 | +| * Description | 0x0002 | +| * WiredAssessedInputVoltage | 0x0003 | +| * WiredAssessedInputFrequency | 0x0004 | +| * WiredCurrentType | 0x0005 | +| * WiredAssessedCurrent | 0x0006 | +| * WiredNominalVoltage | 0x0007 | +| * WiredMaximumCurrent | 0x0008 | +| * WiredPresent | 0x0009 | +| * ActiveWiredFaults | 0x000A | +| * BatteryVoltage | 0x000B | +| * BatteryPercentRemaining | 0x000C | +| * BatteryTimeRemaining | 0x000D | +| * BatteryChargeLevel | 0x000E | +| * BatteryReplacementNeeded | 0x000F | +| * BatteryReplaceability | 0x0010 | +| * BatteryPresent | 0x0011 | +| * ActiveBatteryFaults | 0x0012 | +| * BatteryReplacementDescription | 0x0013 | +| * BatteryCommonDesignation | 0x0014 | +| * BatteryANSIDesignation | 0x0015 | +| * BatteryIECDesignation | 0x0016 | +| * BatteryApprovedChemistry | 0x0017 | +| * BatteryCapacity | 0x0018 | +| * BatteryQuantity | 0x0019 | +| * BatteryChargeState | 0x001A | +| * BatteryTimeToFullCharge | 0x001B | +| * BatteryFunctionalWhileCharging | 0x001C | +| * BatteryChargingCurrent | 0x001D | +| * ActiveBatteryChargeFaults | 0x001E | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute Status + */ +class ReadPowerSourceStatus : public ReadAttribute { +public: + ReadPowerSourceStatus() + : ReadAttribute("status") + { + } + + ~ReadPowerSourceStatus() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.Status response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource Status read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceStatus : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceStatus() + : SubscribeAttribute("status") + { + } + + ~SubscribeAttributePowerSourceStatus() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.Status response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Order + */ +class ReadPowerSourceOrder : public ReadAttribute { +public: + ReadPowerSourceOrder() + : ReadAttribute("order") + { + } + + ~ReadPowerSourceOrder() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.Order response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource Order read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceOrder : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceOrder() + : SubscribeAttribute("order") + { + } + + ~SubscribeAttributePowerSourceOrder() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeOrderWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.Order response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Description + */ +class ReadPowerSourceDescription : public ReadAttribute { +public: + ReadPowerSourceDescription() + : ReadAttribute("description") + { + } + + ~ReadPowerSourceDescription() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.Description response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource Description read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceDescription : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceDescription() + : SubscribeAttribute("description") + { + } + + ~SubscribeAttributePowerSourceDescription() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.Description response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredAssessedInputVoltage + */ +class ReadPowerSourceWiredAssessedInputVoltage : public ReadAttribute { +public: + ReadPowerSourceWiredAssessedInputVoltage() + : ReadAttribute("wired-assessed-input-voltage") + { + } + + ~ReadPowerSourceWiredAssessedInputVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeWiredAssessedInputVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredAssessedInputVoltage read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredAssessedInputVoltage : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredAssessedInputVoltage() + : SubscribeAttribute("wired-assessed-input-voltage") + { + } + + ~SubscribeAttributePowerSourceWiredAssessedInputVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredAssessedInputVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredAssessedInputFrequency + */ +class ReadPowerSourceWiredAssessedInputFrequency : public ReadAttribute { +public: + ReadPowerSourceWiredAssessedInputFrequency() + : ReadAttribute("wired-assessed-input-frequency") + { + } + + ~ReadPowerSourceWiredAssessedInputFrequency() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeWiredAssessedInputFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredAssessedInputFrequency read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredAssessedInputFrequency : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredAssessedInputFrequency() + : SubscribeAttribute("wired-assessed-input-frequency") + { + } + + ~SubscribeAttributePowerSourceWiredAssessedInputFrequency() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredAssessedInputFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredCurrentType + */ +class ReadPowerSourceWiredCurrentType : public ReadAttribute { +public: + ReadPowerSourceWiredCurrentType() + : ReadAttribute("wired-current-type") + { + } + + ~ReadPowerSourceWiredCurrentType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredCurrentTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredCurrentType read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredCurrentType : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredCurrentType() + : SubscribeAttribute("wired-current-type") + { + } + + ~SubscribeAttributePowerSourceWiredCurrentType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeWiredCurrentTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredAssessedCurrent + */ +class ReadPowerSourceWiredAssessedCurrent : public ReadAttribute { +public: + ReadPowerSourceWiredAssessedCurrent() + : ReadAttribute("wired-assessed-current") + { + } + + ~ReadPowerSourceWiredAssessedCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredAssessedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredAssessedCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredAssessedCurrent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredAssessedCurrent() + : SubscribeAttribute("wired-assessed-current") + { + } + + ~SubscribeAttributePowerSourceWiredAssessedCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredAssessedCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredNominalVoltage + */ +class ReadPowerSourceWiredNominalVoltage : public ReadAttribute { +public: + ReadPowerSourceWiredNominalVoltage() + : ReadAttribute("wired-nominal-voltage") + { + } + + ~ReadPowerSourceWiredNominalVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredNominalVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredNominalVoltage read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredNominalVoltage : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredNominalVoltage() + : SubscribeAttribute("wired-nominal-voltage") + { + } + + ~SubscribeAttributePowerSourceWiredNominalVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredNominalVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredMaximumCurrent + */ +class ReadPowerSourceWiredMaximumCurrent : public ReadAttribute { +public: + ReadPowerSourceWiredMaximumCurrent() + : ReadAttribute("wired-maximum-current") + { + } + + ~ReadPowerSourceWiredMaximumCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredMaximumCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredMaximumCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredMaximumCurrent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredMaximumCurrent() + : SubscribeAttribute("wired-maximum-current") + { + } + + ~SubscribeAttributePowerSourceWiredMaximumCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredMaximumCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredPresent + */ +class ReadPowerSourceWiredPresent : public ReadAttribute { +public: + ReadPowerSourceWiredPresent() + : ReadAttribute("wired-present") + { + } + + ~ReadPowerSourceWiredPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredPresent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredPresent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredPresent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredPresent() + : SubscribeAttribute("wired-present") + { + } + + ~SubscribeAttributePowerSourceWiredPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeWiredPresentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredPresent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ActiveWiredFaults + */ +class ReadPowerSourceActiveWiredFaults : public ReadAttribute { +public: + ReadPowerSourceActiveWiredFaults() + : ReadAttribute("active-wired-faults") + { + } + + ~ReadPowerSourceActiveWiredFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeActiveWiredFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ActiveWiredFaults read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceActiveWiredFaults : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceActiveWiredFaults() + : SubscribeAttribute("active-wired-faults") + { + } + + ~SubscribeAttributePowerSourceActiveWiredFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeActiveWiredFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryVoltage + */ +class ReadPowerSourceBatteryVoltage : public ReadAttribute { +public: + ReadPowerSourceBatteryVoltage() + : ReadAttribute("battery-voltage") + { + } + + ~ReadPowerSourceBatteryVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryVoltage response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryVoltage read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryVoltage : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryVoltage() + : SubscribeAttribute("battery-voltage") + { + } + + ~SubscribeAttributePowerSourceBatteryVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryVoltage response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryPercentRemaining + */ +class ReadPowerSourceBatteryPercentRemaining : public ReadAttribute { +public: + ReadPowerSourceBatteryPercentRemaining() + : ReadAttribute("battery-percent-remaining") + { + } + + ~ReadPowerSourceBatteryPercentRemaining() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryPercentRemaining response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryPercentRemaining read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryPercentRemaining : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryPercentRemaining() + : SubscribeAttribute("battery-percent-remaining") + { + } + + ~SubscribeAttributePowerSourceBatteryPercentRemaining() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryPercentRemainingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryPercentRemaining response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryTimeRemaining + */ +class ReadPowerSourceBatteryTimeRemaining : public ReadAttribute { +public: + ReadPowerSourceBatteryTimeRemaining() + : ReadAttribute("battery-time-remaining") + { + } + + ~ReadPowerSourceBatteryTimeRemaining() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000D) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryTimeRemaining response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryTimeRemaining read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryTimeRemaining : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryTimeRemaining() + : SubscribeAttribute("battery-time-remaining") + { + } + + ~SubscribeAttributePowerSourceBatteryTimeRemaining() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryTimeRemainingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryTimeRemaining response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryChargeLevel + */ +class ReadPowerSourceBatteryChargeLevel : public ReadAttribute { +public: + ReadPowerSourceBatteryChargeLevel() + : ReadAttribute("battery-charge-level") + { + } + + ~ReadPowerSourceBatteryChargeLevel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000E) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargeLevel response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryChargeLevel read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryChargeLevel : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryChargeLevel() + : SubscribeAttribute("battery-charge-level") + { + } + + ~SubscribeAttributePowerSourceBatteryChargeLevel() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryChargeLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargeLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryReplacementNeeded + */ +class ReadPowerSourceBatteryReplacementNeeded : public ReadAttribute { +public: + ReadPowerSourceBatteryReplacementNeeded() + : ReadAttribute("battery-replacement-needed") + { + } + + ~ReadPowerSourceBatteryReplacementNeeded() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryReplacementNeededWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementNeeded response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryReplacementNeeded read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryReplacementNeeded : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryReplacementNeeded() + : SubscribeAttribute("battery-replacement-needed") + { + } + + ~SubscribeAttributePowerSourceBatteryReplacementNeeded() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryReplacementNeededWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementNeeded response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryReplaceability + */ +class ReadPowerSourceBatteryReplaceability : public ReadAttribute { +public: + ReadPowerSourceBatteryReplaceability() + : ReadAttribute("battery-replaceability") + { + } + + ~ReadPowerSourceBatteryReplaceability() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryReplaceabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplaceability response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryReplaceability read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryReplaceability : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryReplaceability() + : SubscribeAttribute("battery-replaceability") + { + } + + ~SubscribeAttributePowerSourceBatteryReplaceability() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryReplaceabilityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplaceability response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryPresent + */ +class ReadPowerSourceBatteryPresent : public ReadAttribute { +public: + ReadPowerSourceBatteryPresent() + : ReadAttribute("battery-present") + { + } + + ~ReadPowerSourceBatteryPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryPresent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryPresent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryPresent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryPresent() + : SubscribeAttribute("battery-present") + { + } + + ~SubscribeAttributePowerSourceBatteryPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryPresentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryPresent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ActiveBatteryFaults + */ +class ReadPowerSourceActiveBatteryFaults : public ReadAttribute { +public: + ReadPowerSourceActiveBatteryFaults() + : ReadAttribute("active-battery-faults") + { + } + + ~ReadPowerSourceActiveBatteryFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000012) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ActiveBatteryFaults read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceActiveBatteryFaults() + : SubscribeAttribute("active-battery-faults") + { + } + + ~SubscribeAttributePowerSourceActiveBatteryFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeActiveBatteryFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryReplacementDescription + */ +class ReadPowerSourceBatteryReplacementDescription : public ReadAttribute { +public: + ReadPowerSourceBatteryReplacementDescription() + : ReadAttribute("battery-replacement-description") + { + } + + ~ReadPowerSourceBatteryReplacementDescription() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000013) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryReplacementDescriptionWithCompletionHandler:^( + NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementDescription response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryReplacementDescription read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryReplacementDescription : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryReplacementDescription() + : SubscribeAttribute("battery-replacement-description") + { + } + + ~SubscribeAttributePowerSourceBatteryReplacementDescription() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryReplacementDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementDescription response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryCommonDesignation + */ +class ReadPowerSourceBatteryCommonDesignation : public ReadAttribute { +public: + ReadPowerSourceBatteryCommonDesignation() + : ReadAttribute("battery-common-designation") + { + } + + ~ReadPowerSourceBatteryCommonDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryCommonDesignationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCommonDesignation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryCommonDesignation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryCommonDesignation : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryCommonDesignation() + : SubscribeAttribute("battery-common-designation") + { + } + + ~SubscribeAttributePowerSourceBatteryCommonDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryCommonDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCommonDesignation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryANSIDesignation + */ +class ReadPowerSourceBatteryANSIDesignation : public ReadAttribute { +public: + ReadPowerSourceBatteryANSIDesignation() + : ReadAttribute("battery-ansidesignation") + { + } + + ~ReadPowerSourceBatteryANSIDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryANSIDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryANSIDesignation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryANSIDesignation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryANSIDesignation : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryANSIDesignation() + : SubscribeAttribute("battery-ansidesignation") + { + } + + ~SubscribeAttributePowerSourceBatteryANSIDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryANSIDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryANSIDesignation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryIECDesignation + */ +class ReadPowerSourceBatteryIECDesignation : public ReadAttribute { +public: + ReadPowerSourceBatteryIECDesignation() + : ReadAttribute("battery-iecdesignation") + { + } + + ~ReadPowerSourceBatteryIECDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000016) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryIECDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryIECDesignation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryIECDesignation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryIECDesignation : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryIECDesignation() + : SubscribeAttribute("battery-iecdesignation") + { + } + + ~SubscribeAttributePowerSourceBatteryIECDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000016) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryIECDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryIECDesignation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryApprovedChemistry + */ +class ReadPowerSourceBatteryApprovedChemistry : public ReadAttribute { +public: + ReadPowerSourceBatteryApprovedChemistry() + : ReadAttribute("battery-approved-chemistry") + { + } + + ~ReadPowerSourceBatteryApprovedChemistry() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000017) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryApprovedChemistryWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryApprovedChemistry response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryApprovedChemistry read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryApprovedChemistry : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryApprovedChemistry() + : SubscribeAttribute("battery-approved-chemistry") + { + } + + ~SubscribeAttributePowerSourceBatteryApprovedChemistry() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000017) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryApprovedChemistryWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryApprovedChemistry response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryCapacity + */ +class ReadPowerSourceBatteryCapacity : public ReadAttribute { +public: + ReadPowerSourceBatteryCapacity() + : ReadAttribute("battery-capacity") + { + } + + ~ReadPowerSourceBatteryCapacity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000018) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCapacity response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryCapacity read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryCapacity : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryCapacity() + : SubscribeAttribute("battery-capacity") + { + } + + ~SubscribeAttributePowerSourceBatteryCapacity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000018) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryCapacityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCapacity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryQuantity + */ +class ReadPowerSourceBatteryQuantity : public ReadAttribute { +public: + ReadPowerSourceBatteryQuantity() + : ReadAttribute("battery-quantity") + { + } + + ~ReadPowerSourceBatteryQuantity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000019) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryQuantityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryQuantity response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryQuantity read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryQuantity : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryQuantity() + : SubscribeAttribute("battery-quantity") + { + } + + ~SubscribeAttributePowerSourceBatteryQuantity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000019) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryQuantityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryQuantity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryChargeState + */ +class ReadPowerSourceBatteryChargeState : public ReadAttribute { +public: + ReadPowerSourceBatteryChargeState() + : ReadAttribute("battery-charge-state") + { + } + + ~ReadPowerSourceBatteryChargeState() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryChargeState read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryChargeState : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryChargeState() + : SubscribeAttribute("battery-charge-state") + { + } + + ~SubscribeAttributePowerSourceBatteryChargeState() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryChargeStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryTimeToFullCharge + */ +class ReadPowerSourceBatteryTimeToFullCharge : public ReadAttribute { +public: + ReadPowerSourceBatteryTimeToFullCharge() + : ReadAttribute("battery-time-to-full-charge") + { + } + + ~ReadPowerSourceBatteryTimeToFullCharge() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryTimeToFullChargeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryTimeToFullCharge response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryTimeToFullCharge read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryTimeToFullCharge : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryTimeToFullCharge() + : SubscribeAttribute("battery-time-to-full-charge") + { + } + + ~SubscribeAttributePowerSourceBatteryTimeToFullCharge() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryTimeToFullChargeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryTimeToFullCharge response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryFunctionalWhileCharging + */ +class ReadPowerSourceBatteryFunctionalWhileCharging : public ReadAttribute { +public: + ReadPowerSourceBatteryFunctionalWhileCharging() + : ReadAttribute("battery-functional-while-charging") + { + } + + ~ReadPowerSourceBatteryFunctionalWhileCharging() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryFunctionalWhileChargingWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryFunctionalWhileCharging response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryFunctionalWhileCharging read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryFunctionalWhileCharging : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryFunctionalWhileCharging() + : SubscribeAttribute("battery-functional-while-charging") + { + } + + ~SubscribeAttributePowerSourceBatteryFunctionalWhileCharging() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryFunctionalWhileChargingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryFunctionalWhileCharging response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryChargingCurrent + */ +class ReadPowerSourceBatteryChargingCurrent : public ReadAttribute { +public: + ReadPowerSourceBatteryChargingCurrent() + : ReadAttribute("battery-charging-current") + { + } + + ~ReadPowerSourceBatteryChargingCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001D) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryChargingCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargingCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryChargingCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryChargingCurrent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryChargingCurrent() + : SubscribeAttribute("battery-charging-current") + { + } + + ~SubscribeAttributePowerSourceBatteryChargingCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryChargingCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargingCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ActiveBatteryChargeFaults + */ +class ReadPowerSourceActiveBatteryChargeFaults : public ReadAttribute { +public: + ReadPowerSourceActiveBatteryChargeFaults() + : ReadAttribute("active-battery-charge-faults") + { + } + + ~ReadPowerSourceActiveBatteryChargeFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001E) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeActiveBatteryChargeFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryChargeFaults response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ActiveBatteryChargeFaults read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceActiveBatteryChargeFaults : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceActiveBatteryChargeFaults() + : SubscribeAttribute("active-battery-charge-faults") + { + } + + ~SubscribeAttributePowerSourceActiveBatteryChargeFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeActiveBatteryChargeFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryChargeFaults response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadPowerSourceGeneratedCommandList : public ReadAttribute { +public: + ReadPowerSourceGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadPowerSourceGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributePowerSourceGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadPowerSourceAcceptedCommandList : public ReadAttribute { +public: + ReadPowerSourceAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadPowerSourceAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributePowerSourceAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadPowerSourceAttributeList : public ReadAttribute { +public: + ReadPowerSourceAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadPowerSourceAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceAttributeList : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributePowerSourceAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadPowerSourceFeatureMap : public ReadAttribute { +public: + ReadPowerSourceFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadPowerSourceFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributePowerSourceFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadPowerSourceClusterRevision : public ReadAttribute { +public: + ReadPowerSourceClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadPowerSourceClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributePowerSourceClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster PowerSourceConfiguration | 0x002E | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Sources | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute Sources + */ +class ReadPowerSourceConfigurationSources : public ReadAttribute { +public: + ReadPowerSourceConfigurationSources() + : ReadAttribute("sources") + { + } + + ~ReadPowerSourceConfigurationSources() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSourcesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSourceConfiguration Sources read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceConfigurationSources : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceConfigurationSources() + : SubscribeAttribute("sources") + { + } + + ~SubscribeAttributePowerSourceConfigurationSources() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSourcesWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadPowerSourceConfigurationGeneratedCommandList : public ReadAttribute { +public: + ReadPowerSourceConfigurationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadPowerSourceConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSourceConfiguration GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceConfigurationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceConfigurationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributePowerSourceConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadPowerSourceConfigurationAcceptedCommandList : public ReadAttribute { +public: + ReadPowerSourceConfigurationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadPowerSourceConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSourceConfiguration AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceConfigurationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceConfigurationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributePowerSourceConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadPowerSourceConfigurationAttributeList : public ReadAttribute { +public: + ReadPowerSourceConfigurationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadPowerSourceConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSourceConfiguration AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceConfigurationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceConfigurationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributePowerSourceConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadPowerSourceConfigurationFeatureMap : public ReadAttribute { +public: + ReadPowerSourceConfigurationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadPowerSourceConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSourceConfiguration FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceConfigurationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceConfigurationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributePowerSourceConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadPowerSourceConfigurationClusterRevision : public ReadAttribute { +public: + ReadPowerSourceConfigurationClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadPowerSourceConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSourceConfiguration ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceConfigurationClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceConfigurationClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributePowerSourceConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster PressureMeasurement | 0x0403 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | +| * ScaledValue | 0x0010 | +| * MinScaledValue | 0x0011 | +| * MaxScaledValue | 0x0012 | +| * ScaledTolerance | 0x0013 | +| * Scale | 0x0014 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute MeasuredValue + */ +class ReadPressureMeasurementMeasuredValue : public ReadAttribute { +public: + ReadPressureMeasurementMeasuredValue() + : ReadAttribute("measured-value") + { + } + + ~ReadPressureMeasurementMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementMeasuredValue() + : SubscribeAttribute("measured-value") + { + } + + ~SubscribeAttributePressureMeasurementMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinMeasuredValue + */ +class ReadPressureMeasurementMinMeasuredValue : public ReadAttribute { +public: + ReadPressureMeasurementMinMeasuredValue() + : ReadAttribute("min-measured-value") + { + } + + ~ReadPressureMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementMinMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementMinMeasuredValue() + : SubscribeAttribute("min-measured-value") + { + } + + ~SubscribeAttributePressureMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxMeasuredValue + */ +class ReadPressureMeasurementMaxMeasuredValue : public ReadAttribute { +public: + ReadPressureMeasurementMaxMeasuredValue() + : ReadAttribute("max-measured-value") + { + } + + ~ReadPressureMeasurementMaxMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementMaxMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementMaxMeasuredValue() + : SubscribeAttribute("max-measured-value") + { + } + + ~SubscribeAttributePressureMeasurementMaxMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Tolerance + */ +class ReadPressureMeasurementTolerance : public ReadAttribute { +public: + ReadPressureMeasurementTolerance() + : ReadAttribute("tolerance") + { + } + + ~ReadPressureMeasurementTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementTolerance : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementTolerance() + : SubscribeAttribute("tolerance") + { + } + + ~SubscribeAttributePressureMeasurementTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ScaledValue + */ +class ReadPressureMeasurementScaledValue : public ReadAttribute { +public: + ReadPressureMeasurementScaledValue() + : ReadAttribute("scaled-value") + { + } + + ~ReadPressureMeasurementScaledValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement ScaledValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementScaledValue : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementScaledValue() + : SubscribeAttribute("scaled-value") + { + } + + ~SubscribeAttributePressureMeasurementScaledValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeScaledValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinScaledValue + */ +class ReadPressureMeasurementMinScaledValue : public ReadAttribute { +public: + ReadPressureMeasurementMinScaledValue() + : ReadAttribute("min-scaled-value") + { + } + + ~ReadPressureMeasurementMinScaledValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement MinScaledValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementMinScaledValue : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementMinScaledValue() + : SubscribeAttribute("min-scaled-value") + { + } + + ~SubscribeAttributePressureMeasurementMinScaledValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMinScaledValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxScaledValue + */ +class ReadPressureMeasurementMaxScaledValue : public ReadAttribute { +public: + ReadPressureMeasurementMaxScaledValue() + : ReadAttribute("max-scaled-value") + { + } + + ~ReadPressureMeasurementMaxScaledValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000012) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement MaxScaledValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementMaxScaledValue : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementMaxScaledValue() + : SubscribeAttribute("max-scaled-value") + { + } + + ~SubscribeAttributePressureMeasurementMaxScaledValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMaxScaledValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ScaledTolerance + */ +class ReadPressureMeasurementScaledTolerance : public ReadAttribute { +public: + ReadPressureMeasurementScaledTolerance() + : ReadAttribute("scaled-tolerance") + { + } + + ~ReadPressureMeasurementScaledTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000013) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeScaledToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement ScaledTolerance read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementScaledTolerance : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementScaledTolerance() + : SubscribeAttribute("scaled-tolerance") + { + } + + ~SubscribeAttributePressureMeasurementScaledTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeScaledToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Scale + */ +class ReadPressureMeasurementScale : public ReadAttribute { +public: + ReadPressureMeasurementScale() + : ReadAttribute("scale") + { + } + + ~ReadPressureMeasurementScale() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeScaleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.Scale response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement Scale read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementScale : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementScale() + : SubscribeAttribute("scale") + { + } + + ~SubscribeAttributePressureMeasurementScale() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeScaleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.Scale response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadPressureMeasurementGeneratedCommandList : public ReadAttribute { +public: + ReadPressureMeasurementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadPressureMeasurementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributePressureMeasurementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadPressureMeasurementAcceptedCommandList : public ReadAttribute { +public: + ReadPressureMeasurementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadPressureMeasurementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributePressureMeasurementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadPressureMeasurementAttributeList : public ReadAttribute { +public: + ReadPressureMeasurementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadPressureMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributePressureMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadPressureMeasurementFeatureMap : public ReadAttribute { +public: + ReadPressureMeasurementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadPressureMeasurementFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributePressureMeasurementFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadPressureMeasurementClusterRevision : public ReadAttribute { +public: + ReadPressureMeasurementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadPressureMeasurementClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PressureMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePressureMeasurementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributePressureMeasurementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributePressureMeasurementClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster PumpConfigurationAndControl | 0x0200 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MaxPressure | 0x0000 | +| * MaxSpeed | 0x0001 | +| * MaxFlow | 0x0002 | +| * MinConstPressure | 0x0003 | +| * MaxConstPressure | 0x0004 | +| * MinCompPressure | 0x0005 | +| * MaxCompPressure | 0x0006 | +| * MinConstSpeed | 0x0007 | +| * MaxConstSpeed | 0x0008 | +| * MinConstFlow | 0x0009 | +| * MaxConstFlow | 0x000A | +| * MinConstTemp | 0x000B | +| * MaxConstTemp | 0x000C | +| * PumpStatus | 0x0010 | +| * EffectiveOperationMode | 0x0011 | +| * EffectiveControlMode | 0x0012 | +| * Capacity | 0x0013 | +| * Speed | 0x0014 | +| * LifetimeRunningHours | 0x0015 | +| * Power | 0x0016 | +| * LifetimeEnergyConsumed | 0x0017 | +| * OperationMode | 0x0020 | +| * ControlMode | 0x0021 | +| * AlarmMask | 0x0022 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SupplyVoltageLow | 0x0000 | +| * SupplyVoltageHigh | 0x0001 | +| * PowerMissingPhase | 0x0002 | +| * SystemPressureLow | 0x0003 | +| * SystemPressureHigh | 0x0004 | +| * DryRunning | 0x0005 | +| * MotorTemperatureHigh | 0x0006 | +| * PumpMotorFatalFailure | 0x0007 | +| * ElectronicTemperatureHigh | 0x0008 | +| * PumpBlocked | 0x0009 | +| * SensorFailure | 0x000A | +| * ElectronicNonFatalFailure | 0x000B | +| * ElectronicFatalFailure | 0x000C | +| * GeneralFault | 0x000D | +| * Leakage | 0x000E | +| * AirDetection | 0x000F | +| * TurbineOperation | 0x0010 | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute MaxPressure + */ +class ReadPumpConfigurationAndControlMaxPressure : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxPressure() + : ReadAttribute("max-pressure") + { + } + + ~ReadPumpConfigurationAndControlMaxPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxPressure read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxPressure : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxPressure() + : SubscribeAttribute("max-pressure") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMaxPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxSpeed + */ +class ReadPumpConfigurationAndControlMaxSpeed : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxSpeed() + : ReadAttribute("max-speed") + { + } + + ~ReadPumpConfigurationAndControlMaxSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxSpeed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxSpeed : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxSpeed() + : SubscribeAttribute("max-speed") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxFlow + */ +class ReadPumpConfigurationAndControlMaxFlow : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxFlow() + : ReadAttribute("max-flow") + { + } + + ~ReadPumpConfigurationAndControlMaxFlow() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxFlow read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxFlow : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxFlow() + : SubscribeAttribute("max-flow") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxFlow() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxFlowWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinConstPressure + */ +class ReadPumpConfigurationAndControlMinConstPressure : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMinConstPressure() + : ReadAttribute("min-const-pressure") + { + } + + ~ReadPumpConfigurationAndControlMinConstPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MinConstPressure read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMinConstPressure : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMinConstPressure() + : SubscribeAttribute("min-const-pressure") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMinConstPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinConstPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxConstPressure + */ +class ReadPumpConfigurationAndControlMaxConstPressure : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxConstPressure() + : ReadAttribute("max-const-pressure") + { + } + + ~ReadPumpConfigurationAndControlMaxConstPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstPressure read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxConstPressure : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxConstPressure() + : SubscribeAttribute("max-const-pressure") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxConstPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxConstPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinCompPressure + */ +class ReadPumpConfigurationAndControlMinCompPressure : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMinCompPressure() + : ReadAttribute("min-comp-pressure") + { + } + + ~ReadPumpConfigurationAndControlMinCompPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MinCompPressure read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMinCompPressure : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMinCompPressure() + : SubscribeAttribute("min-comp-pressure") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMinCompPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinCompPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxCompPressure + */ +class ReadPumpConfigurationAndControlMaxCompPressure : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxCompPressure() + : ReadAttribute("max-comp-pressure") + { + } + + ~ReadPumpConfigurationAndControlMaxCompPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxCompPressure read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxCompPressure : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxCompPressure() + : SubscribeAttribute("max-comp-pressure") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxCompPressure() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxCompPressureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinConstSpeed + */ +class ReadPumpConfigurationAndControlMinConstSpeed : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMinConstSpeed() + : ReadAttribute("min-const-speed") + { + } + + ~ReadPumpConfigurationAndControlMinConstSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MinConstSpeed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMinConstSpeed : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMinConstSpeed() + : SubscribeAttribute("min-const-speed") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMinConstSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinConstSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxConstSpeed + */ +class ReadPumpConfigurationAndControlMaxConstSpeed : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxConstSpeed() + : ReadAttribute("max-const-speed") + { + } + + ~ReadPumpConfigurationAndControlMaxConstSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstSpeed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxConstSpeed : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxConstSpeed() + : SubscribeAttribute("max-const-speed") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxConstSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxConstSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinConstFlow + */ +class ReadPumpConfigurationAndControlMinConstFlow : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMinConstFlow() + : ReadAttribute("min-const-flow") + { + } + + ~ReadPumpConfigurationAndControlMinConstFlow() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MinConstFlow read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMinConstFlow : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMinConstFlow() + : SubscribeAttribute("min-const-flow") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMinConstFlow() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMinConstFlowWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxConstFlow + */ +class ReadPumpConfigurationAndControlMaxConstFlow : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxConstFlow() + : ReadAttribute("max-const-flow") + { + } + + ~ReadPumpConfigurationAndControlMaxConstFlow() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstFlow read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxConstFlow : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxConstFlow() + : SubscribeAttribute("max-const-flow") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxConstFlow() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMaxConstFlowWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinConstTemp + */ +class ReadPumpConfigurationAndControlMinConstTemp : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMinConstTemp() + : ReadAttribute("min-const-temp") + { + } + + ~ReadPumpConfigurationAndControlMinConstTemp() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MinConstTemp read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMinConstTemp : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMinConstTemp() + : SubscribeAttribute("min-const-temp") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMinConstTemp() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMinConstTempWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxConstTemp + */ +class ReadPumpConfigurationAndControlMaxConstTemp : public ReadAttribute { +public: + ReadPumpConfigurationAndControlMaxConstTemp() + : ReadAttribute("max-const-temp") + { + } + + ~ReadPumpConfigurationAndControlMaxConstTemp() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl MaxConstTemp read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlMaxConstTemp : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlMaxConstTemp() + : SubscribeAttribute("max-const-temp") + { + } + + ~SubscribeAttributePumpConfigurationAndControlMaxConstTemp() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMaxConstTempWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute PumpStatus + */ +class ReadPumpConfigurationAndControlPumpStatus : public ReadAttribute { +public: + ReadPumpConfigurationAndControlPumpStatus() + : ReadAttribute("pump-status") + { + } + + ~ReadPumpConfigurationAndControlPumpStatus() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl PumpStatus read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlPumpStatus : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlPumpStatus() + : SubscribeAttribute("pump-status") + { + } + + ~SubscribeAttributePumpConfigurationAndControlPumpStatus() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributePumpStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute EffectiveOperationMode + */ +class ReadPumpConfigurationAndControlEffectiveOperationMode : public ReadAttribute { +public: + ReadPumpConfigurationAndControlEffectiveOperationMode() + : ReadAttribute("effective-operation-mode") + { + } + + ~ReadPumpConfigurationAndControlEffectiveOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl EffectiveOperationMode read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode() + : SubscribeAttribute("effective-operation-mode") + { + } + + ~SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeEffectiveOperationModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute EffectiveControlMode + */ +class ReadPumpConfigurationAndControlEffectiveControlMode : public ReadAttribute { +public: + ReadPumpConfigurationAndControlEffectiveControlMode() + : ReadAttribute("effective-control-mode") + { + } + + ~ReadPumpConfigurationAndControlEffectiveControlMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000012) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl EffectiveControlMode read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlEffectiveControlMode : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlEffectiveControlMode() + : SubscribeAttribute("effective-control-mode") + { + } + + ~SubscribeAttributePumpConfigurationAndControlEffectiveControlMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeEffectiveControlModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Capacity + */ +class ReadPumpConfigurationAndControlCapacity : public ReadAttribute { +public: + ReadPumpConfigurationAndControlCapacity() + : ReadAttribute("capacity") + { + } + + ~ReadPumpConfigurationAndControlCapacity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000013) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl Capacity read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlCapacity : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlCapacity() + : SubscribeAttribute("capacity") + { + } + + ~SubscribeAttributePumpConfigurationAndControlCapacity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCapacityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Speed + */ +class ReadPumpConfigurationAndControlSpeed : public ReadAttribute { +public: + ReadPumpConfigurationAndControlSpeed() + : ReadAttribute("speed") + { + } + + ~ReadPumpConfigurationAndControlSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl Speed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlSpeed : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlSpeed() + : SubscribeAttribute("speed") + { + } + + ~SubscribeAttributePumpConfigurationAndControlSpeed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSpeedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute LifetimeRunningHours + */ +class ReadPumpConfigurationAndControlLifetimeRunningHours : public ReadAttribute { +public: + ReadPumpConfigurationAndControlLifetimeRunningHours() + : ReadAttribute("lifetime-running-hours") + { + } + + ~ReadPumpConfigurationAndControlLifetimeRunningHours() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl LifetimeRunningHours read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribute { +public: + WritePumpConfigurationAndControlLifetimeRunningHours() + : WriteAttribute("lifetime-running-hours") + { + AddArgument("attr-name", "lifetime-running-hours"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WritePumpConfigurationAndControlLifetimeRunningHours() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLifetimeRunningHoursWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "PumpConfigurationAndControl LifetimeRunningHours write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours() + : SubscribeAttribute("lifetime-running-hours") + { + } + + ~SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLifetimeRunningHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Power + */ +class ReadPumpConfigurationAndControlPower : public ReadAttribute { +public: + ReadPumpConfigurationAndControlPower() + : ReadAttribute("power") + { + } + + ~ReadPumpConfigurationAndControlPower() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000016) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl Power read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlPower : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlPower() + : SubscribeAttribute("power") + { + } + + ~SubscribeAttributePumpConfigurationAndControlPower() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000016) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePowerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute LifetimeEnergyConsumed + */ +class ReadPumpConfigurationAndControlLifetimeEnergyConsumed : public ReadAttribute { +public: + ReadPumpConfigurationAndControlLifetimeEnergyConsumed() + : ReadAttribute("lifetime-energy-consumed") + { + } + + ~ReadPumpConfigurationAndControlLifetimeEnergyConsumed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000017) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl LifetimeEnergyConsumed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttribute { +public: + WritePumpConfigurationAndControlLifetimeEnergyConsumed() + : WriteAttribute("lifetime-energy-consumed") + { + AddArgument("attr-name", "lifetime-energy-consumed"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WritePumpConfigurationAndControlLifetimeEnergyConsumed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000017) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLifetimeEnergyConsumedWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "PumpConfigurationAndControl LifetimeEnergyConsumed write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed() + : SubscribeAttribute("lifetime-energy-consumed") + { + } + + ~SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000017) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeLifetimeEnergyConsumedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute OperationMode + */ +class ReadPumpConfigurationAndControlOperationMode : public ReadAttribute { +public: + ReadPumpConfigurationAndControlOperationMode() + : ReadAttribute("operation-mode") + { + } + + ~ReadPumpConfigurationAndControlOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000020) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.OperationMode response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl OperationMode read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WritePumpConfigurationAndControlOperationMode : public WriteAttribute { +public: + WritePumpConfigurationAndControlOperationMode() + : WriteAttribute("operation-mode") + { + AddArgument("attr-name", "operation-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WritePumpConfigurationAndControlOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeOperationModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl OperationMode write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributePumpConfigurationAndControlOperationMode : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlOperationMode() + : SubscribeAttribute("operation-mode") + { + } + + ~SubscribeAttributePumpConfigurationAndControlOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeOperationModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.OperationMode response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ControlMode + */ +class ReadPumpConfigurationAndControlControlMode : public ReadAttribute { +public: + ReadPumpConfigurationAndControlControlMode() + : ReadAttribute("control-mode") + { + } + + ~ReadPumpConfigurationAndControlControlMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000021) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl ControlMode read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WritePumpConfigurationAndControlControlMode : public WriteAttribute { +public: + WritePumpConfigurationAndControlControlMode() + : WriteAttribute("control-mode") + { + AddArgument("attr-name", "control-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WritePumpConfigurationAndControlControlMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000021) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeControlModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl ControlMode write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributePumpConfigurationAndControlControlMode : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlControlMode() + : SubscribeAttribute("control-mode") + { + } + + ~SubscribeAttributePumpConfigurationAndControlControlMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000021) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeControlModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AlarmMask + */ +class ReadPumpConfigurationAndControlAlarmMask : public ReadAttribute { +public: + ReadPumpConfigurationAndControlAlarmMask() + : ReadAttribute("alarm-mask") + { + } + + ~ReadPumpConfigurationAndControlAlarmMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000022) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAlarmMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.AlarmMask response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl AlarmMask read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlAlarmMask : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlAlarmMask() + : SubscribeAttribute("alarm-mask") + { + } + + ~SubscribeAttributePumpConfigurationAndControlAlarmMask() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000022) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAlarmMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.AlarmMask response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadPumpConfigurationAndControlGeneratedCommandList : public ReadAttribute { +public: + ReadPumpConfigurationAndControlGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadPumpConfigurationAndControlGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributePumpConfigurationAndControlGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadPumpConfigurationAndControlAcceptedCommandList : public ReadAttribute { +public: + ReadPumpConfigurationAndControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadPumpConfigurationAndControlAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributePumpConfigurationAndControlAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadPumpConfigurationAndControlAttributeList : public ReadAttribute { +public: + ReadPumpConfigurationAndControlAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadPumpConfigurationAndControlAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlAttributeList : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributePumpConfigurationAndControlAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.AttributeList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadPumpConfigurationAndControlFeatureMap : public ReadAttribute { +public: + ReadPumpConfigurationAndControlFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadPumpConfigurationAndControlFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributePumpConfigurationAndControlFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadPumpConfigurationAndControlClusterRevision : public ReadAttribute { +public: + ReadPumpConfigurationAndControlClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadPumpConfigurationAndControlClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PumpConfigurationAndControl ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePumpConfigurationAndControlClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributePumpConfigurationAndControlClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributePumpConfigurationAndControlClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster RelativeHumidityMeasurement | 0x0405 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute MeasuredValue + */ +class ReadRelativeHumidityMeasurementMeasuredValue : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementMeasuredValue() + : ReadAttribute("measured-value") + { + } + + ~ReadRelativeHumidityMeasurementMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementMeasuredValue() + : SubscribeAttribute("measured-value") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinMeasuredValue + */ +class ReadRelativeHumidityMeasurementMinMeasuredValue : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementMinMeasuredValue() + : ReadAttribute("min-measured-value") + { + } + + ~ReadRelativeHumidityMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue() + : SubscribeAttribute("min-measured-value") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxMeasuredValue + */ +class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementMaxMeasuredValue() + : ReadAttribute("max-measured-value") + { + } + + ~ReadRelativeHumidityMeasurementMaxMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue() + : SubscribeAttribute("max-measured-value") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Tolerance + */ +class ReadRelativeHumidityMeasurementTolerance : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementTolerance() + : ReadAttribute("tolerance") + { + } + + ~ReadRelativeHumidityMeasurementTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementTolerance : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementTolerance() + : SubscribeAttribute("tolerance") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadRelativeHumidityMeasurementGeneratedCommandList : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadRelativeHumidityMeasurementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadRelativeHumidityMeasurementAcceptedCommandList : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadRelativeHumidityMeasurementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadRelativeHumidityMeasurementAttributeList : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadRelativeHumidityMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadRelativeHumidityMeasurementFeatureMap : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadRelativeHumidityMeasurementFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadRelativeHumidityMeasurementClusterRevision : public ReadAttribute { +public: + ReadRelativeHumidityMeasurementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadRelativeHumidityMeasurementClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "RelativeHumidityMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeRelativeHumidityMeasurementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeRelativeHumidityMeasurementClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster Scenes | 0x0005 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AddScene | 0x00 | +| * ViewScene | 0x01 | +| * RemoveScene | 0x02 | +| * RemoveAllScenes | 0x03 | +| * StoreScene | 0x04 | +| * RecallScene | 0x05 | +| * GetSceneMembership | 0x06 | +| * EnhancedAddScene | 0x40 | +| * EnhancedViewScene | 0x41 | +| * CopyScene | 0x42 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SceneCount | 0x0000 | +| * CurrentScene | 0x0001 | +| * CurrentGroup | 0x0002 | +| * SceneValid | 0x0003 | +| * NameSupport | 0x0004 | +| * LastConfiguredBy | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command AddScene + */ +class ScenesAddScene : public ClusterCommand { +public: + ScenesAddScene() + : ClusterCommand("add-scene") + , mComplex_ExtensionFieldSets(&mRequest.extensionFieldSets) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + AddArgument("SceneName", &mSceneName); + AddArgument("ExtensionFieldSets", &mComplex_ExtensionFieldSets); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterAddSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.sceneName = [[NSString alloc] initWithBytes:mSceneName.data() + length:mSceneName.size() + encoding:NSUTF8StringEncoding]; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.extensionFieldSets) { + CHIPScenesClusterSceneExtensionFieldSet * newElement_0; + newElement_0 = [CHIPScenesClusterSceneExtensionFieldSet new]; + newElement_0.clusterId = [NSNumber numberWithUnsignedInt:entry_0.clusterId]; + newElement_0.length = [NSNumber numberWithUnsignedChar:entry_0.length]; + newElement_0.value = [NSNumber numberWithUnsignedChar:entry_0.value]; + [array_0 addObject:newElement_0]; + } + params.extensionFieldSets = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addSceneWithParams:params + completionHandler:^(CHIPScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::AddScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; + uint16_t mTransitionTime; + chip::ByteSpan mSceneName; + TypedComplexArgument> + mComplex_ExtensionFieldSets; +}; + +/* + * Command ViewScene + */ +class ScenesViewScene : public ClusterCommand { +public: + ScenesViewScene() + : ClusterCommand("view-scene") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterViewSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster viewSceneWithParams:params + completionHandler:^(CHIPScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::ViewScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; +}; + +/* + * Command RemoveScene + */ +class ScenesRemoveScene : public ClusterCommand { +public: + ScenesRemoveScene() + : ClusterCommand("remove-scene") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterRemoveSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + removeSceneWithParams:params + completionHandler:^(CHIPScenesClusterRemoveSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::RemoveScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; +}; + +/* + * Command RemoveAllScenes + */ +class ScenesRemoveAllScenes : public ClusterCommand { +public: + ScenesRemoveAllScenes() + : ClusterCommand("remove-all-scenes") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterRemoveAllScenesParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster removeAllScenesWithParams:params + completionHandler:^( + CHIPScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type mRequest; + uint16_t mGroupId; +}; + +/* + * Command StoreScene + */ +class ScenesStoreScene : public ClusterCommand { +public: + ScenesStoreScene() + : ClusterCommand("store-scene") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterStoreSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + storeSceneWithParams:params + completionHandler:^(CHIPScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::StoreScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; +}; + +/* + * Command RecallScene + */ +class ScenesRecallScene : public ClusterCommand { +public: + ScenesRecallScene() + : ClusterCommand("recall-scene") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterRecallSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster recallSceneWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::RecallScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; + uint16_t mTransitionTime; +}; + +/* + * Command GetSceneMembership + */ +class ScenesGetSceneMembership : public ClusterCommand { +public: + ScenesGetSceneMembership() + : ClusterCommand("get-scene-membership") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterGetSceneMembershipParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getSceneMembershipWithParams:params + completionHandler:^(CHIPScenesClusterGetSceneMembershipResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type mRequest; + uint16_t mGroupId; +}; + +/* + * Command EnhancedAddScene + */ +class ScenesEnhancedAddScene : public ClusterCommand { +public: + ScenesEnhancedAddScene() + : ClusterCommand("enhanced-add-scene") + , mComplex_ExtensionFieldSets(&mRequest.extensionFieldSets) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime); + AddArgument("SceneName", &mSceneName); + AddArgument("ExtensionFieldSets", &mComplex_ExtensionFieldSets); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000040) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterEnhancedAddSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.sceneName = [[NSString alloc] initWithBytes:mSceneName.data() + length:mSceneName.size() + encoding:NSUTF8StringEncoding]; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.extensionFieldSets) { + CHIPScenesClusterSceneExtensionFieldSet * newElement_0; + newElement_0 = [CHIPScenesClusterSceneExtensionFieldSet new]; + newElement_0.clusterId = [NSNumber numberWithUnsignedInt:entry_0.clusterId]; + newElement_0.length = [NSNumber numberWithUnsignedChar:entry_0.length]; + newElement_0.value = [NSNumber numberWithUnsignedChar:entry_0.value]; + [array_0 addObject:newElement_0]; + } + params.extensionFieldSets = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enhancedAddSceneWithParams:params + completionHandler:^( + CHIPScenesClusterEnhancedAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::EnhancedAddScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; + uint16_t mTransitionTime; + chip::ByteSpan mSceneName; + TypedComplexArgument> + mComplex_ExtensionFieldSets; +}; + +/* + * Command EnhancedViewScene + */ +class ScenesEnhancedViewScene : public ClusterCommand { +public: + ScenesEnhancedViewScene() + : ClusterCommand("enhanced-view-scene") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("GroupId", 0, UINT16_MAX, &mGroupId); + AddArgument("SceneId", 0, UINT8_MAX, &mSceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000041) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterEnhancedViewSceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster enhancedViewSceneWithParams:params + completionHandler:^( + CHIPScenesClusterEnhancedViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::EnhancedViewScene::Type mRequest; + uint16_t mGroupId; + uint8_t mSceneId; +}; + +/* + * Command CopyScene + */ +class ScenesCopyScene : public ClusterCommand { +public: + ScenesCopyScene() + : ClusterCommand("copy-scene") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Mode", 0, UINT8_MAX, &mMode); + AddArgument("GroupIdFrom", 0, UINT16_MAX, &mGroupIdFrom); + AddArgument("SceneIdFrom", 0, UINT8_MAX, &mSceneIdFrom); + AddArgument("GroupIdTo", 0, UINT16_MAX, &mGroupIdTo); + AddArgument("SceneIdTo", 0, UINT8_MAX, &mSceneIdTo); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000042) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPScenesClusterCopySceneParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.mode = [NSNumber numberWithUnsignedChar:mMode]; + params.groupIdFrom = [NSNumber numberWithUnsignedShort:mGroupIdFrom]; + params.sceneIdFrom = [NSNumber numberWithUnsignedChar:mSceneIdFrom]; + params.groupIdTo = [NSNumber numberWithUnsignedShort:mGroupIdTo]; + params.sceneIdTo = [NSNumber numberWithUnsignedChar:mSceneIdTo]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster copySceneWithParams:params + completionHandler:^(CHIPScenesClusterCopySceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::Scenes::Commands::CopyScene::Type mRequest; + uint8_t mMode; + uint16_t mGroupIdFrom; + uint8_t mSceneIdFrom; + uint16_t mGroupIdTo; + uint8_t mSceneIdTo; +}; + +/* + * Attribute SceneCount + */ +class ReadScenesSceneCount : public ReadAttribute { +public: + ReadScenesSceneCount() + : ReadAttribute("scene-count") + { + } + + ~ReadScenesSceneCount() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSceneCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.SceneCount response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes SceneCount read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesSceneCount : public SubscribeAttribute { +public: + SubscribeAttributeScenesSceneCount() + : SubscribeAttribute("scene-count") + { + } + + ~SubscribeAttributeScenesSceneCount() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSceneCountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.SceneCount response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentScene + */ +class ReadScenesCurrentScene : public ReadAttribute { +public: + ReadScenesCurrentScene() + : ReadAttribute("current-scene") + { + } + + ~ReadScenesCurrentScene() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentSceneWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.CurrentScene response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes CurrentScene read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesCurrentScene : public SubscribeAttribute { +public: + SubscribeAttributeScenesCurrentScene() + : SubscribeAttribute("current-scene") + { + } + + ~SubscribeAttributeScenesCurrentScene() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCurrentSceneWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.CurrentScene response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentGroup + */ +class ReadScenesCurrentGroup : public ReadAttribute { +public: + ReadScenesCurrentGroup() + : ReadAttribute("current-group") + { + } + + ~ReadScenesCurrentGroup() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentGroupWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.CurrentGroup response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes CurrentGroup read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesCurrentGroup : public SubscribeAttribute { +public: + SubscribeAttributeScenesCurrentGroup() + : SubscribeAttribute("current-group") + { + } + + ~SubscribeAttributeScenesCurrentGroup() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCurrentGroupWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.CurrentGroup response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute SceneValid + */ +class ReadScenesSceneValid : public ReadAttribute { +public: + ReadScenesSceneValid() + : ReadAttribute("scene-valid") + { + } + + ~ReadScenesSceneValid() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeSceneValidWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.SceneValid response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes SceneValid read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesSceneValid : public SubscribeAttribute { +public: + SubscribeAttributeScenesSceneValid() + : SubscribeAttribute("scene-valid") + { + } + + ~SubscribeAttributeScenesSceneValid() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeSceneValidWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.SceneValid response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute NameSupport + */ +class ReadScenesNameSupport : public ReadAttribute { +public: + ReadScenesNameSupport() + : ReadAttribute("name-support") + { + } + + ~ReadScenesNameSupport() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.NameSupport response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes NameSupport read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesNameSupport : public SubscribeAttribute { +public: + SubscribeAttributeScenesNameSupport() + : SubscribeAttribute("name-support") + { + } + + ~SubscribeAttributeScenesNameSupport() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeNameSupportWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.NameSupport response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute LastConfiguredBy + */ +class ReadScenesLastConfiguredBy : public ReadAttribute { +public: + ReadScenesLastConfiguredBy() + : ReadAttribute("last-configured-by") + { + } + + ~ReadScenesLastConfiguredBy() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeLastConfiguredByWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.LastConfiguredBy response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes LastConfiguredBy read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesLastConfiguredBy : public SubscribeAttribute { +public: + SubscribeAttributeScenesLastConfiguredBy() + : SubscribeAttribute("last-configured-by") + { + } + + ~SubscribeAttributeScenesLastConfiguredBy() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLastConfiguredByWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.LastConfiguredBy response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadScenesGeneratedCommandList : public ReadAttribute { +public: + ReadScenesGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadScenesGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeScenesGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeScenesGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadScenesAcceptedCommandList : public ReadAttribute { +public: + ReadScenesAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadScenesAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeScenesAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeScenesAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadScenesAttributeList : public ReadAttribute { +public: + ReadScenesAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadScenesAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeScenesAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeScenesAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadScenesFeatureMap : public ReadAttribute { +public: + ReadScenesFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadScenesFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeScenesFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeScenesFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadScenesClusterRevision : public ReadAttribute { +public: + ReadScenesClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadScenesClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Scenes ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeScenesClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeScenesClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeScenesClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Scenes.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster SoftwareDiagnostics | 0x0034 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ResetWatermarks | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ThreadMetrics | 0x0000 | +| * CurrentHeapFree | 0x0001 | +| * CurrentHeapUsed | 0x0002 | +| * CurrentHeapHighWatermark | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SoftwareFault | 0x0000 | +\*----------------------------------------------------------------------------*/ + +/* + * Command ResetWatermarks + */ +class SoftwareDiagnosticsResetWatermarks : public ClusterCommand { +public: + SoftwareDiagnosticsResetWatermarks() + : ClusterCommand("reset-watermarks") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPSoftwareDiagnosticsClusterResetWatermarksParams 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 resetWatermarksWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type mRequest; +}; + +/* + * Attribute ThreadMetrics + */ +class ReadSoftwareDiagnosticsThreadMetrics : public ReadAttribute { +public: + ReadSoftwareDiagnosticsThreadMetrics() + : ReadAttribute("thread-metrics") + { + } + + ~ReadSoftwareDiagnosticsThreadMetrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics ThreadMetrics read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsThreadMetrics : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsThreadMetrics() + : SubscribeAttribute("thread-metrics") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsThreadMetrics() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeThreadMetricsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentHeapFree + */ +class ReadSoftwareDiagnosticsCurrentHeapFree : public ReadAttribute { +public: + ReadSoftwareDiagnosticsCurrentHeapFree() + : ReadAttribute("current-heap-free") + { + } + + ~ReadSoftwareDiagnosticsCurrentHeapFree() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics CurrentHeapFree read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree() + : SubscribeAttribute("current-heap-free") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeCurrentHeapFreeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentHeapUsed + */ +class ReadSoftwareDiagnosticsCurrentHeapUsed : public ReadAttribute { +public: + ReadSoftwareDiagnosticsCurrentHeapUsed() + : ReadAttribute("current-heap-used") + { + } + + ~ReadSoftwareDiagnosticsCurrentHeapUsed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics CurrentHeapUsed read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed() + : SubscribeAttribute("current-heap-used") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeCurrentHeapUsedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentHeapHighWatermark + */ +class ReadSoftwareDiagnosticsCurrentHeapHighWatermark : public ReadAttribute { +public: + ReadSoftwareDiagnosticsCurrentHeapHighWatermark() + : ReadAttribute("current-heap-high-watermark") + { + } + + ~ReadSoftwareDiagnosticsCurrentHeapHighWatermark() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics CurrentHeapHighWatermark read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark() + : SubscribeAttribute("current-heap-high-watermark") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeCurrentHeapHighWatermarkWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadSoftwareDiagnosticsGeneratedCommandList : public ReadAttribute { +public: + ReadSoftwareDiagnosticsGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadSoftwareDiagnosticsGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadSoftwareDiagnosticsAcceptedCommandList : public ReadAttribute { +public: + ReadSoftwareDiagnosticsAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadSoftwareDiagnosticsAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadSoftwareDiagnosticsAttributeList : public ReadAttribute { +public: + ReadSoftwareDiagnosticsAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadSoftwareDiagnosticsAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadSoftwareDiagnosticsFeatureMap : public ReadAttribute { +public: + ReadSoftwareDiagnosticsFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadSoftwareDiagnosticsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadSoftwareDiagnosticsClusterRevision : public ReadAttribute { +public: + ReadSoftwareDiagnosticsClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadSoftwareDiagnosticsClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "SoftwareDiagnostics ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSoftwareDiagnosticsClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeSoftwareDiagnosticsClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeSoftwareDiagnosticsClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster Switch | 0x003B | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * NumberOfPositions | 0x0000 | +| * CurrentPosition | 0x0001 | +| * MultiPressMax | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SwitchLatched | 0x0000 | +| * InitialPress | 0x0001 | +| * LongPress | 0x0002 | +| * ShortRelease | 0x0003 | +| * LongRelease | 0x0004 | +| * MultiPressOngoing | 0x0005 | +| * MultiPressComplete | 0x0006 | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute NumberOfPositions + */ +class ReadSwitchNumberOfPositions : public ReadAttribute { +public: + ReadSwitchNumberOfPositions() + : ReadAttribute("number-of-positions") + { + } + + ~ReadSwitchNumberOfPositions() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.NumberOfPositions response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch NumberOfPositions read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchNumberOfPositions : public SubscribeAttribute { +public: + SubscribeAttributeSwitchNumberOfPositions() + : SubscribeAttribute("number-of-positions") + { + } + + ~SubscribeAttributeSwitchNumberOfPositions() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeNumberOfPositionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.NumberOfPositions response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentPosition + */ +class ReadSwitchCurrentPosition : public ReadAttribute { +public: + ReadSwitchCurrentPosition() + : ReadAttribute("current-position") + { + } + + ~ReadSwitchCurrentPosition() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.CurrentPosition response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch CurrentPosition read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchCurrentPosition : public SubscribeAttribute { +public: + SubscribeAttributeSwitchCurrentPosition() + : SubscribeAttribute("current-position") + { + } + + ~SubscribeAttributeSwitchCurrentPosition() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCurrentPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.CurrentPosition response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MultiPressMax + */ +class ReadSwitchMultiPressMax : public ReadAttribute { +public: + ReadSwitchMultiPressMax() + : ReadAttribute("multi-press-max") + { + } + + ~ReadSwitchMultiPressMax() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.MultiPressMax response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch MultiPressMax read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchMultiPressMax : public SubscribeAttribute { +public: + SubscribeAttributeSwitchMultiPressMax() + : SubscribeAttribute("multi-press-max") + { + } + + ~SubscribeAttributeSwitchMultiPressMax() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMultiPressMaxWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.MultiPressMax response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadSwitchGeneratedCommandList : public ReadAttribute { +public: + ReadSwitchGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadSwitchGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSwitchGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeSwitchGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadSwitchAcceptedCommandList : public ReadAttribute { +public: + ReadSwitchAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadSwitchAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSwitchAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeSwitchAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadSwitchAttributeList : public ReadAttribute { +public: + ReadSwitchAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadSwitchAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeSwitchAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeSwitchAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadSwitchFeatureMap : public ReadAttribute { +public: + ReadSwitchFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadSwitchFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeSwitchFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeSwitchFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadSwitchClusterRevision : public ReadAttribute { +public: + ReadSwitchClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadSwitchClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Switch ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeSwitchClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeSwitchClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Switch.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster TargetNavigator | 0x0505 | +|------------------------------------------------------------------------------| +| Commands: | | +| * NavigateTarget | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * TargetList | 0x0000 | +| * CurrentTarget | 0x0001 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command NavigateTarget + */ +class TargetNavigatorNavigateTarget : public ClusterCommand { +public: + TargetNavigatorNavigateTarget() + : ClusterCommand("navigate-target") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Target", 0, UINT8_MAX, &mTarget); + AddArgument("Data", &mData); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTargetNavigatorClusterNavigateTargetParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.target = [NSNumber numberWithUnsignedChar:mTarget]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster navigateTargetWithParams:params + completionHandler:^(CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type mRequest; + uint8_t mTarget; + chip::Optional mData; +}; + +/* + * Attribute TargetList + */ +class ReadTargetNavigatorTargetList : public ReadAttribute { +public: + ReadTargetNavigatorTargetList() + : ReadAttribute("target-list") + { + } + + ~ReadTargetNavigatorTargetList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeTargetListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.TargetList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator TargetList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorTargetList : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorTargetList() + : SubscribeAttribute("target-list") + { + } + + ~SubscribeAttributeTargetNavigatorTargetList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeTargetListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.TargetList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute CurrentTarget + */ +class ReadTargetNavigatorCurrentTarget : public ReadAttribute { +public: + ReadTargetNavigatorCurrentTarget() + : ReadAttribute("current-target") + { + } + + ~ReadTargetNavigatorCurrentTarget() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeCurrentTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator CurrentTarget read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorCurrentTarget : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorCurrentTarget() + : SubscribeAttribute("current-target") + { + } + + ~SubscribeAttributeTargetNavigatorCurrentTarget() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeCurrentTargetWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadTargetNavigatorGeneratedCommandList : public ReadAttribute { +public: + ReadTargetNavigatorGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadTargetNavigatorGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeTargetNavigatorGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadTargetNavigatorAcceptedCommandList : public ReadAttribute { +public: + ReadTargetNavigatorAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadTargetNavigatorAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeTargetNavigatorAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadTargetNavigatorAttributeList : public ReadAttribute { +public: + ReadTargetNavigatorAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadTargetNavigatorAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeTargetNavigatorAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadTargetNavigatorFeatureMap : public ReadAttribute { +public: + ReadTargetNavigatorFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadTargetNavigatorFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeTargetNavigatorFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadTargetNavigatorClusterRevision : public ReadAttribute { +public: + ReadTargetNavigatorClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadTargetNavigatorClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TargetNavigator ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeTargetNavigatorClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeTargetNavigatorClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster TemperatureMeasurement | 0x0402 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute MeasuredValue + */ +class ReadTemperatureMeasurementMeasuredValue : public ReadAttribute { +public: + ReadTemperatureMeasurementMeasuredValue() + : ReadAttribute("measured-value") + { + } + + ~ReadTemperatureMeasurementMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement MeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementMeasuredValue() + : SubscribeAttribute("measured-value") + { + } + + ~SubscribeAttributeTemperatureMeasurementMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MinMeasuredValue + */ +class ReadTemperatureMeasurementMinMeasuredValue : public ReadAttribute { +public: + ReadTemperatureMeasurementMinMeasuredValue() + : ReadAttribute("min-measured-value") + { + } + + ~ReadTemperatureMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement MinMeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementMinMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementMinMeasuredValue() + : SubscribeAttribute("min-measured-value") + { + } + + ~SubscribeAttributeTemperatureMeasurementMinMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute MaxMeasuredValue + */ +class ReadTemperatureMeasurementMaxMeasuredValue : public ReadAttribute { +public: + ReadTemperatureMeasurementMaxMeasuredValue() + : ReadAttribute("max-measured-value") + { + } + + ~ReadTemperatureMeasurementMaxMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement MaxMeasuredValue read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementMaxMeasuredValue : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementMaxMeasuredValue() + : SubscribeAttribute("max-measured-value") + { + } + + ~SubscribeAttributeTemperatureMeasurementMaxMeasuredValue() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxMeasuredValueWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Tolerance + */ +class ReadTemperatureMeasurementTolerance : public ReadAttribute { +public: + ReadTemperatureMeasurementTolerance() + : ReadAttribute("tolerance") + { + } + + ~ReadTemperatureMeasurementTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement Tolerance read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementTolerance : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementTolerance() + : SubscribeAttribute("tolerance") + { + } + + ~SubscribeAttributeTemperatureMeasurementTolerance() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeToleranceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadTemperatureMeasurementGeneratedCommandList : public ReadAttribute { +public: + ReadTemperatureMeasurementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadTemperatureMeasurementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeTemperatureMeasurementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadTemperatureMeasurementAcceptedCommandList : public ReadAttribute { +public: + ReadTemperatureMeasurementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadTemperatureMeasurementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeTemperatureMeasurementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AttributeList + */ +class ReadTemperatureMeasurementAttributeList : public ReadAttribute { +public: + ReadTemperatureMeasurementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadTemperatureMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeTemperatureMeasurementAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadTemperatureMeasurementFeatureMap : public ReadAttribute { +public: + ReadTemperatureMeasurementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadTemperatureMeasurementFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeTemperatureMeasurementFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadTemperatureMeasurementClusterRevision : public ReadAttribute { +public: + ReadTemperatureMeasurementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadTemperatureMeasurementClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.ClusterRevision response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TemperatureMeasurement ClusterRevision read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTemperatureMeasurementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeTemperatureMeasurementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeTemperatureMeasurementClusterRevision() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TemperatureMeasurement.ClusterRevision response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/*----------------------------------------------------------------------------*\ +| Cluster TestCluster | 0x050F | +|------------------------------------------------------------------------------| +| Commands: | | +| * Test | 0x00 | +| * TestNotHandled | 0x01 | +| * TestSpecific | 0x02 | +| * TestUnknownCommand | 0x03 | +| * TestAddArguments | 0x04 | +| * TestSimpleArgumentRequest | 0x05 | +| * TestStructArrayArgumentRequest | 0x06 | +| * TestStructArgumentRequest | 0x07 | +| * TestNestedStructArgumentRequest | 0x08 | +| * TestListStructArgumentRequest | 0x09 | +| * TestListInt8UArgumentRequest | 0x0A | +| * TestNestedStructListArgumentRequest | 0x0B | +| * TestListNestedStructListArgumentRequest | 0x0C | +| * TestListInt8UReverseRequest | 0x0D | +| * TestEnumsRequest | 0x0E | +| * TestNullableOptionalRequest | 0x0F | +| * TestComplexNullableOptionalRequest | 0x10 | +| * SimpleStructEchoRequest | 0x11 | +| * TimedInvokeRequest | 0x12 | +| * TestSimpleOptionalArgumentRequest | 0x13 | +| * TestEmitTestEventRequest | 0x14 | +| * TestEmitTestFabricScopedEventRequest | 0x15 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Boolean | 0x0000 | +| * Bitmap8 | 0x0001 | +| * Bitmap16 | 0x0002 | +| * Bitmap32 | 0x0003 | +| * Bitmap64 | 0x0004 | +| * Int8u | 0x0005 | +| * Int16u | 0x0006 | +| * Int24u | 0x0007 | +| * Int32u | 0x0008 | +| * Int40u | 0x0009 | +| * Int48u | 0x000A | +| * Int56u | 0x000B | +| * Int64u | 0x000C | +| * Int8s | 0x000D | +| * Int16s | 0x000E | +| * Int24s | 0x000F | +| * Int32s | 0x0010 | +| * Int40s | 0x0011 | +| * Int48s | 0x0012 | +| * Int56s | 0x0013 | +| * Int64s | 0x0014 | +| * Enum8 | 0x0015 | +| * Enum16 | 0x0016 | +| * FloatSingle | 0x0017 | +| * FloatDouble | 0x0018 | +| * OctetString | 0x0019 | +| * ListInt8u | 0x001A | +| * ListOctetString | 0x001B | +| * ListStructOctetString | 0x001C | +| * LongOctetString | 0x001D | +| * CharString | 0x001E | +| * LongCharString | 0x001F | +| * EpochUs | 0x0020 | +| * EpochS | 0x0021 | +| * VendorId | 0x0022 | +| * ListNullablesAndOptionalsStruct | 0x0023 | +| * EnumAttr | 0x0024 | +| * StructAttr | 0x0025 | +| * RangeRestrictedInt8u | 0x0026 | +| * RangeRestrictedInt8s | 0x0027 | +| * RangeRestrictedInt16u | 0x0028 | +| * RangeRestrictedInt16s | 0x0029 | +| * ListLongOctetString | 0x002A | +| * ListFabricScoped | 0x002B | +| * TimedWriteBoolean | 0x0030 | +| * GeneralErrorBoolean | 0x0031 | +| * ClusterErrorBoolean | 0x0032 | +| * Unsupported | 0x00FF | +| * NullableBoolean | 0x4000 | +| * NullableBitmap8 | 0x4001 | +| * NullableBitmap16 | 0x4002 | +| * NullableBitmap32 | 0x4003 | +| * NullableBitmap64 | 0x4004 | +| * NullableInt8u | 0x4005 | +| * NullableInt16u | 0x4006 | +| * NullableInt24u | 0x4007 | +| * NullableInt32u | 0x4008 | +| * NullableInt40u | 0x4009 | +| * NullableInt48u | 0x400A | +| * NullableInt56u | 0x400B | +| * NullableInt64u | 0x400C | +| * NullableInt8s | 0x400D | +| * NullableInt16s | 0x400E | +| * NullableInt24s | 0x400F | +| * NullableInt32s | 0x4010 | +| * NullableInt40s | 0x4011 | +| * NullableInt48s | 0x4012 | +| * NullableInt56s | 0x4013 | +| * NullableInt64s | 0x4014 | +| * NullableEnum8 | 0x4015 | +| * NullableEnum16 | 0x4016 | +| * NullableFloatSingle | 0x4017 | +| * NullableFloatDouble | 0x4018 | +| * NullableOctetString | 0x4019 | +| * NullableCharString | 0x401E | +| * NullableEnumAttr | 0x4024 | +| * NullableStruct | 0x4025 | +| * NullableRangeRestrictedInt8u | 0x4026 | +| * NullableRangeRestrictedInt8s | 0x4027 | +| * NullableRangeRestrictedInt16u | 0x4028 | +| * NullableRangeRestrictedInt16s | 0x4029 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * TestEvent | 0x0001 | +| * TestFabricScopedEvent | 0x0002 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Test + */ +class TestClusterTest : public ClusterCommand { +public: + TestClusterTest() + : ClusterCommand("test") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestParams 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 testWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::Test::Type mRequest; +}; + +/* + * Command TestNotHandled + */ +class TestClusterTestNotHandled : public ClusterCommand { +public: + TestClusterTestNotHandled() + : ClusterCommand("test-not-handled") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestNotHandledParams 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 testNotHandledWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type mRequest; +}; + +/* + * Command TestSpecific + */ +class TestClusterTestSpecific : public ClusterCommand { +public: + TestClusterTestSpecific() + : ClusterCommand("test-specific") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestSpecificParams 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 testSpecificWithCompletionHandler:^( + CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestSpecific::Type mRequest; +}; + +/* + * Command TestUnknownCommand + */ +class TestClusterTestUnknownCommand : public ClusterCommand { +public: + TestClusterTestUnknownCommand() + : ClusterCommand("test-unknown-command") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestUnknownCommandParams 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 testUnknownCommandWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type mRequest; +}; + +/* + * Command TestAddArguments + */ +class TestClusterTestAddArguments : public ClusterCommand { +public: + TestClusterTestAddArguments() + : ClusterCommand("test-add-arguments") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, UINT8_MAX, &mArg1); + AddArgument("Arg2", 0, UINT8_MAX, &mArg2); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testAddArgumentsWithParams:params + completionHandler:^(CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type mRequest; + uint8_t mArg1; + uint8_t mArg2; +}; + +/* + * Command TestSimpleArgumentRequest + */ +class TestClusterTestSimpleArgumentRequest : public ClusterCommand { +public: + TestClusterTestSimpleArgumentRequest() + : ClusterCommand("test-simple-argument-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, 1, &mArg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestSimpleArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [NSNumber numberWithBool:mArg1]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + testSimpleArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestSimpleArgumentResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestSimpleArgumentRequest::Type mRequest; + bool mArg1; +}; + +/* + * Command TestStructArrayArgumentRequest + */ +class TestClusterTestStructArrayArgumentRequest : public ClusterCommand { +public: + TestClusterTestStructArrayArgumentRequest() + : ClusterCommand("test-struct-array-argument-request") + , mComplex_Arg1(&mRequest.arg1) + , mComplex_Arg2(&mRequest.arg2) + , mComplex_Arg3(&mRequest.arg3) + , mComplex_Arg4(&mRequest.arg4) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + AddArgument("Arg2", &mComplex_Arg2); + AddArgument("Arg3", &mComplex_Arg3); + AddArgument("Arg4", &mComplex_Arg4); + AddArgument("Arg5", 0, UINT8_MAX, &mArg5); + AddArgument("Arg6", 0, 1, &mArg6); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestStructArrayArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg1) { + CHIPTestClusterClusterNestedStructList * newElement_0; + newElement_0 = [CHIPTestClusterClusterNestedStructList new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; + newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; + newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; + newElement_0.c.d = [NSData dataWithBytes:entry_0.c.d.data() length:entry_0.c.d.size()]; + newElement_0.c.e = [[NSString alloc] initWithBytes:entry_0.c.e.data() + length:entry_0.c.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; + newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; + newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.d) { + CHIPTestClusterClusterSimpleStruct * newElement_2; + newElement_2 = [CHIPTestClusterClusterSimpleStruct new]; + newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; + newElement_2.b = [NSNumber numberWithBool:entry_2.b]; + newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; + newElement_2.d = [NSData dataWithBytes:entry_2.d.data() length:entry_2.d.size()]; + newElement_2.e = [[NSString alloc] initWithBytes:entry_2.e.data() + length:entry_2.e.size() + encoding:NSUTF8StringEncoding]; + newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; + newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; + newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + [array_2 addObject:newElement_2]; + } + newElement_0.d = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.e) { + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; + [array_2 addObject:newElement_2]; + } + newElement_0.e = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.f) { + NSData * newElement_2; + newElement_2 = [NSData dataWithBytes:entry_2.data() length:entry_2.size()]; + [array_2 addObject:newElement_2]; + } + newElement_0.f = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.g) { + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; + [array_2 addObject:newElement_2]; + } + newElement_0.g = array_2; + } + [array_0 addObject:newElement_0]; + } + params.arg1 = array_0; + } + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg2) { + CHIPTestClusterClusterSimpleStruct * newElement_0; + newElement_0 = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; + newElement_0.d = [NSData dataWithBytes:entry_0.d.data() length:entry_0.d.size()]; + newElement_0.e = [[NSString alloc] initWithBytes:entry_0.e.data() + length:entry_0.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; + newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; + newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + [array_0 addObject:newElement_0]; + } + params.arg2 = array_0; + } + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg3) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + params.arg3 = array_0; + } + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg4) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithBool:entry_0]; + [array_0 addObject:newElement_0]; + } + params.arg4 = array_0; + } + params.arg5 = [NSNumber numberWithUnsignedChar:mArg5]; + params.arg6 = [NSNumber numberWithBool:mArg6]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testStructArrayArgumentRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestStructArrayArgumentResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestStructArrayArgumentRequest::Type mRequest; + TypedComplexArgument> + mComplex_Arg1; + TypedComplexArgument> + mComplex_Arg2; + TypedComplexArgument> mComplex_Arg3; + TypedComplexArgument> mComplex_Arg4; + uint8_t mArg5; + bool mArg6; +}; + +/* + * Command TestStructArgumentRequest + */ +class TestClusterTestStructArgumentRequest : public ClusterCommand { +public: + TestClusterTestStructArgumentRequest() + : ClusterCommand("test-struct-argument-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [CHIPTestClusterClusterSimpleStruct new]; + params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; + params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; + params.arg1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c)]; + params.arg1.d = [NSData dataWithBytes:mRequest.arg1.d.data() length:mRequest.arg1.d.size()]; + params.arg1.e = [[NSString alloc] initWithBytes:mRequest.arg1.e.data() + length:mRequest.arg1.e.size() + encoding:NSUTF8StringEncoding]; + params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()]; + params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g]; + params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; +}; + +/* + * Command TestNestedStructArgumentRequest + */ +class TestClusterTestNestedStructArgumentRequest : public ClusterCommand { +public: + TestClusterTestNestedStructArgumentRequest() + : ClusterCommand("test-nested-struct-argument-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [CHIPTestClusterClusterNestedStruct new]; + params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; + params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; + params.arg1.c = [CHIPTestClusterClusterSimpleStruct new]; + params.arg1.c.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.a]; + params.arg1.c.b = [NSNumber numberWithBool:mRequest.arg1.c.b]; + params.arg1.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.c)]; + params.arg1.c.d = [NSData dataWithBytes:mRequest.arg1.c.d.data() length:mRequest.arg1.c.d.size()]; + params.arg1.c.e = [[NSString alloc] initWithBytes:mRequest.arg1.c.e.data() + length:mRequest.arg1.c.e.size() + encoding:NSUTF8StringEncoding]; + params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()]; + params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g]; + params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testNestedStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; +}; + +/* + * Command TestListStructArgumentRequest + */ +class TestClusterTestListStructArgumentRequest : public ClusterCommand { +public: + TestClusterTestListStructArgumentRequest() + : ClusterCommand("test-list-struct-argument-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg1) { + CHIPTestClusterClusterSimpleStruct * newElement_0; + newElement_0 = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; + newElement_0.d = [NSData dataWithBytes:entry_0.d.data() length:entry_0.d.size()]; + newElement_0.e = [[NSString alloc] initWithBytes:entry_0.e.data() + length:entry_0.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; + newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; + newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + [array_0 addObject:newElement_0]; + } + params.arg1 = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testListStructArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type mRequest; + TypedComplexArgument> + mComplex_Arg1; +}; + +/* + * Command TestListInt8UArgumentRequest + */ +class TestClusterTestListInt8UArgumentRequest : public ClusterCommand { +public: + TestClusterTestListInt8UArgumentRequest() + : ClusterCommand("test-list-int8uargument-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg1) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + params.arg1 = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testListInt8UArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type mRequest; + TypedComplexArgument> mComplex_Arg1; +}; + +/* + * Command TestNestedStructListArgumentRequest + */ +class TestClusterTestNestedStructListArgumentRequest : public ClusterCommand { +public: + TestClusterTestNestedStructListArgumentRequest() + : ClusterCommand("test-nested-struct-list-argument-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [CHIPTestClusterClusterNestedStructList new]; + params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; + params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; + params.arg1.c = [CHIPTestClusterClusterSimpleStruct new]; + params.arg1.c.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.a]; + params.arg1.c.b = [NSNumber numberWithBool:mRequest.arg1.c.b]; + params.arg1.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.c)]; + params.arg1.c.d = [NSData dataWithBytes:mRequest.arg1.c.d.data() length:mRequest.arg1.c.d.size()]; + params.arg1.c.e = [[NSString alloc] initWithBytes:mRequest.arg1.c.e.data() + length:mRequest.arg1.c.e.size() + encoding:NSUTF8StringEncoding]; + params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()]; + params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g]; + params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; for (auto & entry_1 : mRequest.arg1.d) { CHIPTestClusterClusterSimpleStruct * newElement_1; newElement_1 = [CHIPTestClusterClusterSimpleStruct new]; @@ -54385,415 +73834,3919 @@ class TestClusterTestNestedStructListArgumentRequest : public ClusterCommand { newElement_1.h = [NSNumber numberWithDouble:entry_1.h]; [array_1 addObject:newElement_1]; } - params.arg1.d = array_1; - } - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - for (auto & entry_1 : mRequest.arg1.e) { - NSNumber * newElement_1; - newElement_1 = [NSNumber numberWithUnsignedInt:entry_1]; - [array_1 addObject:newElement_1]; + params.arg1.d = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.arg1.e) { + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedInt:entry_1]; + [array_1 addObject:newElement_1]; + } + params.arg1.e = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.arg1.f) { + NSData * newElement_1; + newElement_1 = [NSData dataWithBytes:entry_1.data() length:entry_1.size()]; + [array_1 addObject:newElement_1]; + } + params.arg1.f = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.arg1.g) { + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:entry_1]; + [array_1 addObject:newElement_1]; + } + params.arg1.g = array_1; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; +}; + +/* + * Command TestListNestedStructListArgumentRequest + */ +class TestClusterTestListNestedStructListArgumentRequest : public ClusterCommand { +public: + TestClusterTestListNestedStructListArgumentRequest() + : ClusterCommand("test-list-nested-struct-list-argument-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg1) { + CHIPTestClusterClusterNestedStructList * newElement_0; + newElement_0 = [CHIPTestClusterClusterNestedStructList new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; + newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; + newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; + newElement_0.c.d = [NSData dataWithBytes:entry_0.c.d.data() length:entry_0.c.d.size()]; + newElement_0.c.e = [[NSString alloc] initWithBytes:entry_0.c.e.data() + length:entry_0.c.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; + newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; + newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.d) { + CHIPTestClusterClusterSimpleStruct * newElement_2; + newElement_2 = [CHIPTestClusterClusterSimpleStruct new]; + newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; + newElement_2.b = [NSNumber numberWithBool:entry_2.b]; + newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; + newElement_2.d = [NSData dataWithBytes:entry_2.d.data() length:entry_2.d.size()]; + newElement_2.e = [[NSString alloc] initWithBytes:entry_2.e.data() + length:entry_2.e.size() + encoding:NSUTF8StringEncoding]; + newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; + newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; + newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + [array_2 addObject:newElement_2]; + } + newElement_0.d = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.e) { + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; + [array_2 addObject:newElement_2]; + } + newElement_0.e = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.f) { + NSData * newElement_2; + newElement_2 = [NSData dataWithBytes:entry_2.data() length:entry_2.size()]; + [array_2 addObject:newElement_2]; + } + newElement_0.f = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.g) { + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; + [array_2 addObject:newElement_2]; + } + newElement_0.g = array_2; + } + [array_0 addObject:newElement_0]; + } + params.arg1 = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + testListNestedStructListArgumentRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type mRequest; + TypedComplexArgument> + mComplex_Arg1; +}; + +/* + * Command TestListInt8UReverseRequest + */ +class TestClusterTestListInt8UReverseRequest : public ClusterCommand { +public: + TestClusterTestListInt8UReverseRequest() + : ClusterCommand("test-list-int8ureverse-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000D) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.arg1) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + params.arg1 = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + testListInt8UReverseRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type mRequest; + TypedComplexArgument> mComplex_Arg1; +}; + +/* + * Command TestEnumsRequest + */ +class TestClusterTestEnumsRequest : public ClusterCommand { +public: + TestClusterTestEnumsRequest() + : ClusterCommand("test-enums-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, UINT16_MAX, &mArg1); + AddArgument("Arg2", 0, UINT8_MAX, &mArg2); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000E) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [NSNumber numberWithUnsignedShort:mArg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testEnumsRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type mRequest; + chip::VendorId mArg1; + uint8_t mArg2; +}; + +/* + * Command TestNullableOptionalRequest + */ +class TestClusterTestNullableOptionalRequest : public ClusterCommand { +public: + TestClusterTestNullableOptionalRequest() + : ClusterCommand("test-nullable-optional-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, UINT8_MAX, &mArg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000F) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + if (mArg1.HasValue()) { + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1.Value()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + testNullableOptionalRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type mRequest; + chip::Optional mArg1; +}; + +/* + * Command TestComplexNullableOptionalRequest + */ +class TestClusterTestComplexNullableOptionalRequest : public ClusterCommand { +public: + TestClusterTestComplexNullableOptionalRequest() + : ClusterCommand("test-complex-nullable-optional-request") + , mComplex_NullableStruct(&mRequest.nullableStruct) + , mComplex_OptionalStruct(&mRequest.optionalStruct) + , mComplex_NullableOptionalStruct(&mRequest.nullableOptionalStruct) + , mComplex_NullableList(&mRequest.nullableList) + , mComplex_OptionalList(&mRequest.optionalList) + , mComplex_NullableOptionalList(&mRequest.nullableOptionalList) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NullableInt", 0, UINT16_MAX, &mNullableInt); + AddArgument("OptionalInt", 0, UINT16_MAX, &mOptionalInt); + AddArgument("NullableOptionalInt", 0, UINT16_MAX, &mNullableOptionalInt); + AddArgument("NullableString", &mNullableString); + AddArgument("OptionalString", &mOptionalString); + AddArgument("NullableOptionalString", &mNullableOptionalString); + AddArgument("NullableStruct", &mComplex_NullableStruct); + AddArgument("OptionalStruct", &mComplex_OptionalStruct); + AddArgument("NullableOptionalStruct", &mComplex_NullableOptionalStruct); + AddArgument("NullableList", &mComplex_NullableList); + AddArgument("OptionalList", &mComplex_OptionalList); + AddArgument("NullableOptionalList", &mComplex_NullableOptionalList); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestComplexNullableOptionalRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.nullableInt = [NSNumber numberWithUnsignedShort:mNullableInt]; + if (mOptionalInt.HasValue()) { + params.optionalInt = [NSNumber numberWithUnsignedShort:mOptionalInt.Value()]; + } + if (mNullableOptionalInt.HasValue()) { + params.nullableOptionalInt = [NSNumber numberWithUnsignedShort:mNullableOptionalInt.Value()]; + } + params.nullableString = [[NSString alloc] initWithBytes:mNullableString.data() + length:mNullableString.size() + encoding:NSUTF8StringEncoding]; + if (mOptionalString.HasValue()) { + params.optionalString = [[NSString alloc] initWithBytes:mOptionalString.Value().data() + length:mOptionalString.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (mNullableOptionalString.HasValue()) { + params.nullableOptionalString = [[NSString alloc] initWithBytes:mNullableOptionalString.Value().data() + length:mNullableOptionalString.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (mRequest.nullableStruct.IsNull()) { + params.nullableStruct = nil; + } else { + params.nullableStruct = [CHIPTestClusterClusterSimpleStruct new]; + params.nullableStruct.a = [NSNumber numberWithUnsignedChar:mRequest.nullableStruct.Value().a]; + params.nullableStruct.b = [NSNumber numberWithBool:mRequest.nullableStruct.Value().b]; + params.nullableStruct.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.nullableStruct.Value().c)]; + params.nullableStruct.d = [NSData dataWithBytes:mRequest.nullableStruct.Value().d.data() + length:mRequest.nullableStruct.Value().d.size()]; + params.nullableStruct.e = [[NSString alloc] initWithBytes:mRequest.nullableStruct.Value().e.data() + length:mRequest.nullableStruct.Value().e.size() + encoding:NSUTF8StringEncoding]; + params.nullableStruct.f = [NSNumber numberWithUnsignedChar:mRequest.nullableStruct.Value().f.Raw()]; + params.nullableStruct.g = [NSNumber numberWithFloat:mRequest.nullableStruct.Value().g]; + params.nullableStruct.h = [NSNumber numberWithDouble:mRequest.nullableStruct.Value().h]; + } + if (mRequest.optionalStruct.HasValue()) { + params.optionalStruct = [CHIPTestClusterClusterSimpleStruct new]; + params.optionalStruct.a = [NSNumber numberWithUnsignedChar:mRequest.optionalStruct.Value().a]; + params.optionalStruct.b = [NSNumber numberWithBool:mRequest.optionalStruct.Value().b]; + params.optionalStruct.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.optionalStruct.Value().c)]; + params.optionalStruct.d = [NSData dataWithBytes:mRequest.optionalStruct.Value().d.data() + length:mRequest.optionalStruct.Value().d.size()]; + params.optionalStruct.e = [[NSString alloc] initWithBytes:mRequest.optionalStruct.Value().e.data() + length:mRequest.optionalStruct.Value().e.size() + encoding:NSUTF8StringEncoding]; + params.optionalStruct.f = [NSNumber numberWithUnsignedChar:mRequest.optionalStruct.Value().f.Raw()]; + params.optionalStruct.g = [NSNumber numberWithFloat:mRequest.optionalStruct.Value().g]; + params.optionalStruct.h = [NSNumber numberWithDouble:mRequest.optionalStruct.Value().h]; + } else { + params.optionalStruct = nil; + } + if (mRequest.nullableOptionalStruct.HasValue()) { + if (mRequest.nullableOptionalStruct.Value().IsNull()) { + params.nullableOptionalStruct = nil; + } else { + params.nullableOptionalStruct = [CHIPTestClusterClusterSimpleStruct new]; + params.nullableOptionalStruct.a = + [NSNumber numberWithUnsignedChar:mRequest.nullableOptionalStruct.Value().Value().a]; + params.nullableOptionalStruct.b = [NSNumber numberWithBool:mRequest.nullableOptionalStruct.Value().Value().b]; + params.nullableOptionalStruct.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.nullableOptionalStruct.Value().Value().c)]; + params.nullableOptionalStruct.d = [NSData dataWithBytes:mRequest.nullableOptionalStruct.Value().Value().d.data() + length:mRequest.nullableOptionalStruct.Value().Value().d.size()]; + params.nullableOptionalStruct.e = + [[NSString alloc] initWithBytes:mRequest.nullableOptionalStruct.Value().Value().e.data() + length:mRequest.nullableOptionalStruct.Value().Value().e.size() + encoding:NSUTF8StringEncoding]; + params.nullableOptionalStruct.f = + [NSNumber numberWithUnsignedChar:mRequest.nullableOptionalStruct.Value().Value().f.Raw()]; + params.nullableOptionalStruct.g = [NSNumber numberWithFloat:mRequest.nullableOptionalStruct.Value().Value().g]; + params.nullableOptionalStruct.h = [NSNumber numberWithDouble:mRequest.nullableOptionalStruct.Value().Value().h]; + } + } else { + params.nullableOptionalStruct = nil; + } + if (mRequest.nullableList.IsNull()) { + params.nullableList = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.nullableList.Value()) { + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + params.nullableList = array_1; + } + } + if (mRequest.optionalList.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.optionalList.Value()) { + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + params.optionalList = array_1; + } + } else { + params.optionalList = nil; + } + if (mRequest.nullableOptionalList.HasValue()) { + if (mRequest.nullableOptionalList.Value().IsNull()) { + params.nullableOptionalList = nil; + } else { + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : mRequest.nullableOptionalList.Value().Value()) { + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2)]; + [array_2 addObject:newElement_2]; + } + params.nullableOptionalList = array_2; + } + } + } else { + params.nullableOptionalList = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + testComplexNullableOptionalRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestComplexNullableOptionalResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestComplexNullableOptionalRequest::Type mRequest; + uint16_t mNullableInt; + chip::Optional mOptionalInt; + chip::Optional mNullableOptionalInt; + chip::ByteSpan mNullableString; + chip::Optional mOptionalString; + chip::Optional mNullableOptionalString; + TypedComplexArgument> + mComplex_NullableStruct; + TypedComplexArgument> mComplex_OptionalStruct; + TypedComplexArgument< + chip::Optional>> + mComplex_NullableOptionalStruct; + TypedComplexArgument< + chip::app::DataModel::Nullable>> + mComplex_NullableList; + TypedComplexArgument>> + mComplex_OptionalList; + TypedComplexArgument>>> + mComplex_NullableOptionalList; +}; + +/* + * Command SimpleStructEchoRequest + */ +class TestClusterSimpleStructEchoRequest : public ClusterCommand { +public: + TestClusterSimpleStructEchoRequest() + : ClusterCommand("simple-struct-echo-request") + , mComplex_Arg1(&mRequest.arg1) + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", &mComplex_Arg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [CHIPTestClusterClusterSimpleStruct new]; + params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; + params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; + params.arg1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c)]; + params.arg1.d = [NSData dataWithBytes:mRequest.arg1.d.data() length:mRequest.arg1.d.size()]; + params.arg1.e = [[NSString alloc] initWithBytes:mRequest.arg1.e.data() + length:mRequest.arg1.e.size() + encoding:NSUTF8StringEncoding]; + params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()]; + params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g]; + params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster simpleStructEchoRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; +}; + +/* + * Command TimedInvokeRequest + */ +class TestClusterTimedInvokeRequest : public ClusterCommand { +public: + TestClusterTimedInvokeRequest() + : ClusterCommand("timed-invoke-request") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000012) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTimedInvokeRequestParams 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 timedInvokeRequestWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type mRequest; +}; + +/* + * Command TestSimpleOptionalArgumentRequest + */ +class TestClusterTestSimpleOptionalArgumentRequest : public ClusterCommand { +public: + TestClusterTestSimpleOptionalArgumentRequest() + : ClusterCommand("test-simple-optional-argument-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, 1, &mArg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000013) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + if (mArg1.HasValue()) { + params.arg1 = [NSNumber numberWithBool:mArg1.Value()]; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type mRequest; + chip::Optional mArg1; +}; + +/* + * Command TestEmitTestEventRequest + */ +class TestClusterTestEmitTestEventRequest : public ClusterCommand { +public: + TestClusterTestEmitTestEventRequest() + : ClusterCommand("test-emit-test-event-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, UINT8_MAX, &mArg1); + AddArgument("Arg2", 0, UINT8_MAX, &mArg2); + AddArgument("Arg3", 0, 1, &mArg3); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestEmitTestEventRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; + params.arg3 = [NSNumber numberWithBool:mArg3]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster testEmitTestEventRequestWithParams:params + completionHandler:^(CHIPTestClusterClusterTestEmitTestEventResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type mRequest; + uint8_t mArg1; + uint8_t mArg2; + bool mArg3; +}; + +/* + * Command TestEmitTestFabricScopedEventRequest + */ +class TestClusterTestEmitTestFabricScopedEventRequest : public ClusterCommand { +public: + TestClusterTestEmitTestFabricScopedEventRequest() + : ClusterCommand("test-emit-test-fabric-scoped-event-request") + { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Arg1", 0, UINT8_MAX, &mArg1); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPTestClusterClusterTestEmitTestFabricScopedEventRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + testEmitTestFabricScopedEventRequestWithParams:params + completionHandler:^( + CHIPTestClusterClusterTestEmitTestFabricScopedEventResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::TestCluster::Commands::TestEmitTestFabricScopedEventRequest::Type mRequest; + uint8_t mArg1; +}; + +/* + * Attribute Boolean + */ +class ReadTestClusterBoolean : public ReadAttribute { +public: + ReadTestClusterBoolean() + : ReadAttribute("boolean") + { + } + + ~ReadTestClusterBoolean() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Boolean response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Boolean read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterBoolean : public WriteAttribute { +public: + WriteTestClusterBoolean() + : WriteAttribute("boolean") + { + AddArgument("attr-name", "boolean"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterBoolean() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeBooleanWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Boolean write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + bool mValue; +}; + +class SubscribeAttributeTestClusterBoolean : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterBoolean() + : SubscribeAttribute("boolean") + { + } + + ~SubscribeAttributeTestClusterBoolean() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Boolean response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Bitmap8 + */ +class ReadTestClusterBitmap8 : public ReadAttribute { +public: + ReadTestClusterBitmap8() + : ReadAttribute("bitmap8") + { + } + + ~ReadTestClusterBitmap8() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap8 response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap8 read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterBitmap8 : public WriteAttribute { +public: + WriteTestClusterBitmap8() + : WriteAttribute("bitmap8") + { + AddArgument("attr-name", "bitmap8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterBitmap8() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeBitmap8WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap8 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeTestClusterBitmap8 : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterBitmap8() + : SubscribeAttribute("bitmap8") + { + } + + ~SubscribeAttributeTestClusterBitmap8() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBitmap8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap8 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Bitmap16 + */ +class ReadTestClusterBitmap16 : public ReadAttribute { +public: + ReadTestClusterBitmap16() + : ReadAttribute("bitmap16") + { + } + + ~ReadTestClusterBitmap16() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap16 response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap16 read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterBitmap16 : public WriteAttribute { +public: + WriteTestClusterBitmap16() + : WriteAttribute("bitmap16") + { + AddArgument("attr-name", "bitmap16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterBitmap16() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeBitmap16WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap16 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeTestClusterBitmap16 : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterBitmap16() + : SubscribeAttribute("bitmap16") + { + } + + ~SubscribeAttributeTestClusterBitmap16() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBitmap16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap16 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Bitmap32 + */ +class ReadTestClusterBitmap32 : public ReadAttribute { +public: + ReadTestClusterBitmap32() + : ReadAttribute("bitmap32") + { + } + + ~ReadTestClusterBitmap32() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap32 response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap32 read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterBitmap32 : public WriteAttribute { +public: + WriteTestClusterBitmap32() + : WriteAttribute("bitmap32") + { + AddArgument("attr-name", "bitmap32"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterBitmap32() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeBitmap32WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap32 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeTestClusterBitmap32 : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterBitmap32() + : SubscribeAttribute("bitmap32") + { + } + + ~SubscribeAttributeTestClusterBitmap32() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBitmap32WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap32 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Bitmap64 + */ +class ReadTestClusterBitmap64 : public ReadAttribute { +public: + ReadTestClusterBitmap64() + : ReadAttribute("bitmap64") + { + } + + ~ReadTestClusterBitmap64() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap64 response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap64 read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterBitmap64 : public WriteAttribute { +public: + WriteTestClusterBitmap64() + : WriteAttribute("bitmap64") + { + AddArgument("attr-name", "bitmap64"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterBitmap64() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + + [cluster writeAttributeBitmap64WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Bitmap64 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint64_t mValue; +}; + +class SubscribeAttributeTestClusterBitmap64 : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterBitmap64() + : SubscribeAttribute("bitmap64") + { + } + + ~SubscribeAttributeTestClusterBitmap64() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBitmap64WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Bitmap64 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int8u + */ +class ReadTestClusterInt8u : public ReadAttribute { +public: + ReadTestClusterInt8u() + : ReadAttribute("int8u") + { + } + + ~ReadTestClusterInt8u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int8u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int8u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt8u : public WriteAttribute { +public: + WriteTestClusterInt8u() + : WriteAttribute("int8u") + { + AddArgument("attr-name", "int8u"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt8u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeInt8uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int8u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeTestClusterInt8u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt8u() + : SubscribeAttribute("int8u") + { + } + + ~SubscribeAttributeTestClusterInt8u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int8u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int16u + */ +class ReadTestClusterInt16u : public ReadAttribute { +public: + ReadTestClusterInt16u() + : ReadAttribute("int16u") + { + } + + ~ReadTestClusterInt16u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int16u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int16u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt16u : public WriteAttribute { +public: + WriteTestClusterInt16u() + : WriteAttribute("int16u") + { + AddArgument("attr-name", "int16u"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt16u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeInt16uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int16u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeTestClusterInt16u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt16u() + : SubscribeAttribute("int16u") + { + } + + ~SubscribeAttributeTestClusterInt16u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int16u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int24u + */ +class ReadTestClusterInt24u : public ReadAttribute { +public: + ReadTestClusterInt24u() + : ReadAttribute("int24u") + { + } + + ~ReadTestClusterInt24u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt24uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int24u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int24u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt24u : public WriteAttribute { +public: + WriteTestClusterInt24u() + : WriteAttribute("int24u") + { + AddArgument("attr-name", "int24u"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt24u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeInt24uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int24u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeTestClusterInt24u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt24u() + : SubscribeAttribute("int24u") + { + } + + ~SubscribeAttributeTestClusterInt24u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt24uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int24u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int32u + */ +class ReadTestClusterInt32u : public ReadAttribute { +public: + ReadTestClusterInt32u() + : ReadAttribute("int32u") + { + } + + ~ReadTestClusterInt32u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int32u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int32u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt32u : public WriteAttribute { +public: + WriteTestClusterInt32u() + : WriteAttribute("int32u") + { + AddArgument("attr-name", "int32u"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt32u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeInt32uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int32u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeTestClusterInt32u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt32u() + : SubscribeAttribute("int32u") + { + } + + ~SubscribeAttributeTestClusterInt32u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt32uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int32u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int40u + */ +class ReadTestClusterInt40u : public ReadAttribute { +public: + ReadTestClusterInt40u() + : ReadAttribute("int40u") + { + } + + ~ReadTestClusterInt40u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt40uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int40u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int40u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt40u : public WriteAttribute { +public: + WriteTestClusterInt40u() + : WriteAttribute("int40u") + { + AddArgument("attr-name", "int40u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt40u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + + [cluster writeAttributeInt40uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int40u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint64_t mValue; +}; + +class SubscribeAttributeTestClusterInt40u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt40u() + : SubscribeAttribute("int40u") + { + } + + ~SubscribeAttributeTestClusterInt40u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt40uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int40u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int48u + */ +class ReadTestClusterInt48u : public ReadAttribute { +public: + ReadTestClusterInt48u() + : ReadAttribute("int48u") + { + } + + ~ReadTestClusterInt48u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt48uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int48u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int48u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt48u : public WriteAttribute { +public: + WriteTestClusterInt48u() + : WriteAttribute("int48u") + { + AddArgument("attr-name", "int48u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt48u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + + [cluster writeAttributeInt48uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int48u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint64_t mValue; +}; + +class SubscribeAttributeTestClusterInt48u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt48u() + : SubscribeAttribute("int48u") + { + } + + ~SubscribeAttributeTestClusterInt48u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt48uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int48u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int56u + */ +class ReadTestClusterInt56u : public ReadAttribute { +public: + ReadTestClusterInt56u() + : ReadAttribute("int56u") + { + } + + ~ReadTestClusterInt56u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt56uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int56u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int56u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt56u : public WriteAttribute { +public: + WriteTestClusterInt56u() + : WriteAttribute("int56u") + { + AddArgument("attr-name", "int56u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt56u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + + [cluster writeAttributeInt56uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int56u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint64_t mValue; +}; + +class SubscribeAttributeTestClusterInt56u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt56u() + : SubscribeAttribute("int56u") + { + } + + ~SubscribeAttributeTestClusterInt56u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt56uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int56u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int64u + */ +class ReadTestClusterInt64u : public ReadAttribute { +public: + ReadTestClusterInt64u() + : ReadAttribute("int64u") + { + } + + ~ReadTestClusterInt64u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int64u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int64u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt64u : public WriteAttribute { +public: + WriteTestClusterInt64u() + : WriteAttribute("int64u") + { + AddArgument("attr-name", "int64u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt64u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + + [cluster writeAttributeInt64uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int64u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint64_t mValue; +}; + +class SubscribeAttributeTestClusterInt64u : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt64u() + : SubscribeAttribute("int64u") + { + } + + ~SubscribeAttributeTestClusterInt64u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt64uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int64u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int8s + */ +class ReadTestClusterInt8s : public ReadAttribute { +public: + ReadTestClusterInt8s() + : ReadAttribute("int8s") + { + } + + ~ReadTestClusterInt8s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000D) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int8s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int8s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt8s : public WriteAttribute { +public: + WriteTestClusterInt8s() + : WriteAttribute("int8s") + { + AddArgument("attr-name", "int8s"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt8s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; + + [cluster writeAttributeInt8sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int8s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int8_t mValue; +}; + +class SubscribeAttributeTestClusterInt8s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt8s() + : SubscribeAttribute("int8s") + { + } + + ~SubscribeAttributeTestClusterInt8s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int8s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int16s + */ +class ReadTestClusterInt16s : public ReadAttribute { +public: + ReadTestClusterInt16s() + : ReadAttribute("int16s") + { + } + + ~ReadTestClusterInt16s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000E) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int16s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int16s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt16s : public WriteAttribute { +public: + WriteTestClusterInt16s() + : WriteAttribute("int16s") + { + AddArgument("attr-name", "int16s"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt16s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + + [cluster writeAttributeInt16sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int16s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int16_t mValue; +}; + +class SubscribeAttributeTestClusterInt16s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt16s() + : SubscribeAttribute("int16s") + { + } + + ~SubscribeAttributeTestClusterInt16s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int16s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int24s + */ +class ReadTestClusterInt24s : public ReadAttribute { +public: + ReadTestClusterInt24s() + : ReadAttribute("int24s") + { + } + + ~ReadTestClusterInt24s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt24sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int24s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int24s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt24s : public WriteAttribute { +public: + WriteTestClusterInt24s() + : WriteAttribute("int24s") + { + AddArgument("attr-name", "int24s"); + AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt24s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000F) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithInt:mValue]; + + [cluster writeAttributeInt24sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int24s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int32_t mValue; +}; + +class SubscribeAttributeTestClusterInt24s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt24s() + : SubscribeAttribute("int24s") + { + } + + ~SubscribeAttributeTestClusterInt24s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt24sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int24s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int32s + */ +class ReadTestClusterInt32s : public ReadAttribute { +public: + ReadTestClusterInt32s() + : ReadAttribute("int32s") + { + } + + ~ReadTestClusterInt32s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int32s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int32s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt32s : public WriteAttribute { +public: + WriteTestClusterInt32s() + : WriteAttribute("int32s") + { + AddArgument("attr-name", "int32s"); + AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt32s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithInt:mValue]; + + [cluster writeAttributeInt32sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int32s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int32_t mValue; +}; + +class SubscribeAttributeTestClusterInt32s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt32s() + : SubscribeAttribute("int32s") + { + } + + ~SubscribeAttributeTestClusterInt32s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt32sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int32s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int40s + */ +class ReadTestClusterInt40s : public ReadAttribute { +public: + ReadTestClusterInt40s() + : ReadAttribute("int40s") + { + } + + ~ReadTestClusterInt40s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt40sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int40s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int40s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt40s : public WriteAttribute { +public: + WriteTestClusterInt40s() + : WriteAttribute("int40s") + { + AddArgument("attr-name", "int40s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt40s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + + [cluster writeAttributeInt40sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int40s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int64_t mValue; +}; + +class SubscribeAttributeTestClusterInt40s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt40s() + : SubscribeAttribute("int40s") + { + } + + ~SubscribeAttributeTestClusterInt40s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt40sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int40s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int48s + */ +class ReadTestClusterInt48s : public ReadAttribute { +public: + ReadTestClusterInt48s() + : ReadAttribute("int48s") + { + } + + ~ReadTestClusterInt48s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000012) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt48sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int48s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int48s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt48s : public WriteAttribute { +public: + WriteTestClusterInt48s() + : WriteAttribute("int48s") + { + AddArgument("attr-name", "int48s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt48s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + + [cluster writeAttributeInt48sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int48s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int64_t mValue; +}; + +class SubscribeAttributeTestClusterInt48s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt48s() + : SubscribeAttribute("int48s") + { + } + + ~SubscribeAttributeTestClusterInt48s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt48sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int48s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int56s + */ +class ReadTestClusterInt56s : public ReadAttribute { +public: + ReadTestClusterInt56s() + : ReadAttribute("int56s") + { + } + + ~ReadTestClusterInt56s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000013) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt56sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int56s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int56s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt56s : public WriteAttribute { +public: + WriteTestClusterInt56s() + : WriteAttribute("int56s") + { + AddArgument("attr-name", "int56s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt56s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + + [cluster writeAttributeInt56sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int56s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int64_t mValue; +}; + +class SubscribeAttributeTestClusterInt56s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt56s() + : SubscribeAttribute("int56s") + { + } + + ~SubscribeAttributeTestClusterInt56s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt56sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int56s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Int64s + */ +class ReadTestClusterInt64s : public ReadAttribute { +public: + ReadTestClusterInt64s() + : ReadAttribute("int64s") + { + } + + ~ReadTestClusterInt64s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int64s response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int64s read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterInt64s : public WriteAttribute { +public: + WriteTestClusterInt64s() + : WriteAttribute("int64s") + { + AddArgument("attr-name", "int64s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterInt64s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + + [cluster writeAttributeInt64sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Int64s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + int64_t mValue; +}; + +class SubscribeAttributeTestClusterInt64s : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterInt64s() + : SubscribeAttribute("int64s") + { + } + + ~SubscribeAttributeTestClusterInt64s() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeInt64sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Int64s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Enum8 + */ +class ReadTestClusterEnum8 : public ReadAttribute { +public: + ReadTestClusterEnum8() + : ReadAttribute("enum8") + { + } + + ~ReadTestClusterEnum8() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Enum8 response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Enum8 read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterEnum8 : public WriteAttribute { +public: + WriteTestClusterEnum8() + : WriteAttribute("enum8") + { + AddArgument("attr-name", "enum8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterEnum8() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeEnum8WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Enum8 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeTestClusterEnum8 : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterEnum8() + : SubscribeAttribute("enum8") + { + } + + ~SubscribeAttributeTestClusterEnum8() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeEnum8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Enum8 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute Enum16 + */ +class ReadTestClusterEnum16 : public ReadAttribute { +public: + ReadTestClusterEnum16() + : ReadAttribute("enum16") + { + } + + ~ReadTestClusterEnum16() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000016) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Enum16 response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster Enum16 read Error: %s", chip::ErrorStr(err)); } - params.arg1.e = array_1; - } - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - for (auto & entry_1 : mRequest.arg1.f) { - NSData * newElement_1; - newElement_1 = [NSData dataWithBytes:entry_1.data() length:entry_1.size()]; - [array_1 addObject:newElement_1]; + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterEnum16 : public WriteAttribute { +public: + WriteTestClusterEnum16() + : WriteAttribute("enum16") + { + AddArgument("attr-name", "enum16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterEnum16() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000016) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeEnum16WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster Enum16 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeTestClusterEnum16 : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterEnum16() + : SubscribeAttribute("enum16") + { + } + + ~SubscribeAttributeTestClusterEnum16() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000016) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeEnum16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Enum16 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FloatSingle + */ +class ReadTestClusterFloatSingle : public ReadAttribute { +public: + ReadTestClusterFloatSingle() + : ReadAttribute("float-single") + { + } + + ~ReadTestClusterFloatSingle() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000017) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.FloatSingle response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster FloatSingle read Error: %s", chip::ErrorStr(err)); } - params.arg1.f = array_1; - } - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - for (auto & entry_1 : mRequest.arg1.g) { - NSNumber * newElement_1; - newElement_1 = [NSNumber numberWithUnsignedChar:entry_1]; - [array_1 addObject:newElement_1]; + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterFloatSingle : public WriteAttribute { +public: + WriteTestClusterFloatSingle() + : WriteAttribute("float-single") + { + AddArgument("attr-name", "float-single"); + AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterFloatSingle() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000017) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithFloat:mValue]; + + [cluster + writeAttributeFloatSingleWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster FloatSingle write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + float mValue; +}; + +class SubscribeAttributeTestClusterFloatSingle : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterFloatSingle() + : SubscribeAttribute("float-single") + { + } + + ~SubscribeAttributeTestClusterFloatSingle() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000017) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFloatSingleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.FloatSingle response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FloatDouble + */ +class ReadTestClusterFloatDouble : public ReadAttribute { +public: + ReadTestClusterFloatDouble() + : ReadAttribute("float-double") + { + } + + ~ReadTestClusterFloatDouble() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000018) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.FloatDouble response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster FloatDouble read Error: %s", chip::ErrorStr(err)); } - params.arg1.g = array_1; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testNestedStructListArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterFloatDouble : public WriteAttribute { +public: + WriteTestClusterFloatDouble() + : WriteAttribute("float-double") + { + AddArgument("attr-name", "float-double"); + AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterFloatDouble() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000018) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithDouble:mValue]; + + [cluster + writeAttributeFloatDoubleWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster FloatDouble write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } -private: - chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; +private: + double mValue; +}; + +class SubscribeAttributeTestClusterFloatDouble : public SubscribeAttribute { +public: + SubscribeAttributeTestClusterFloatDouble() + : SubscribeAttribute("float-double") + { + } + + ~SubscribeAttributeTestClusterFloatDouble() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000018) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFloatDoubleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.FloatDouble response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command TestNotHandled + * Attribute OctetString */ -class TestClusterTestNotHandled : public ClusterCommand { +class ReadTestClusterOctetString : public ReadAttribute { public: - TestClusterTestNotHandled() - : ClusterCommand("test-not-handled") + ReadTestClusterOctetString() + : ReadAttribute("octet-string") { - ClusterCommand::AddArguments(); } + ~ReadTestClusterOctetString() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestNotHandledParams 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 testNotHandledWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.OctetString response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "TestCluster OctetString read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command TestNullableOptionalRequest - */ -class TestClusterTestNullableOptionalRequest : public ClusterCommand { +class WriteTestClusterOctetString : public WriteAttribute { public: - TestClusterTestNullableOptionalRequest() - : ClusterCommand("test-nullable-optional-request") + WriteTestClusterOctetString() + : WriteAttribute("octet-string") { - AddArgument("Arg1", 0, UINT8_MAX, &mArg1); - ClusterCommand::AddArguments(); + AddArgument("attr-name", "octet-string"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); } + ~WriteTestClusterOctetString() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000F) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - if (mArg1.HasValue()) { - params.arg1 = [NSNumber numberWithUnsignedChar:mArg1.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster - testNullableOptionalRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } + NSData * _Nonnull value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + + [cluster + writeAttributeOctetStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster OctetString write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::Optional mArg1; + chip::ByteSpan mValue; }; -/* - * Command TestSimpleOptionalArgumentRequest - */ -class TestClusterTestSimpleOptionalArgumentRequest : public ClusterCommand { +class SubscribeAttributeTestClusterOctetString : public SubscribeAttribute { public: - TestClusterTestSimpleOptionalArgumentRequest() - : ClusterCommand("test-simple-optional-argument-request") + SubscribeAttributeTestClusterOctetString() + : SubscribeAttribute("octet-string") { - AddArgument("Arg1", 0, 1, &mArg1); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeTestClusterOctetString() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000013) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - if (mArg1.HasValue()) { - params.arg1 = [NSNumber numberWithBool:mArg1.Value()]; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.OctetString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::Optional mArg1; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command TestSpecific + * Attribute ListInt8u */ -class TestClusterTestSpecific : public ClusterCommand { +class ReadTestClusterListInt8u : public ReadAttribute { public: - TestClusterTestSpecific() - : ClusterCommand("test-specific") + ReadTestClusterListInt8u() + : ReadAttribute("list-int8u") { - ClusterCommand::AddArguments(); } + ~ReadTestClusterListInt8u() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListInt8u response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListInt8u read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterListInt8u : public WriteAttribute { +public: + WriteTestClusterListInt8u() + : WriteAttribute("list-int8u") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-int8u"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterListInt8u() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestSpecificParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testSpecificWithCompletionHandler:^( - CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + value = array_0; } + + [cluster writeAttributeListInt8uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListInt8u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; }; -/* - * Command TestStructArgumentRequest - */ -class TestClusterTestStructArgumentRequest : public ClusterCommand { +class SubscribeAttributeTestClusterListInt8u : public SubscribeAttribute { public: - TestClusterTestStructArgumentRequest() - : ClusterCommand("test-struct-argument-request") - , mComplex_Arg1(&mRequest.arg1) + SubscribeAttributeTestClusterListInt8u() + : SubscribeAttribute("list-int8u") { - AddArgument("Arg1", &mComplex_Arg1); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeTestClusterListInt8u() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000007) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [CHIPTestClusterClusterSimpleStruct new]; - params.arg1.a = [NSNumber numberWithUnsignedChar:mRequest.arg1.a]; - params.arg1.b = [NSNumber numberWithBool:mRequest.arg1.b]; - params.arg1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c)]; - params.arg1.d = [NSData dataWithBytes:mRequest.arg1.d.data() length:mRequest.arg1.d.size()]; - params.arg1.e = [[NSString alloc] initWithBytes:mRequest.arg1.e.data() - length:mRequest.arg1.e.size() - encoding:NSUTF8StringEncoding]; - params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()]; - params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g]; - params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testStructArgumentRequestWithParams:params - completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeListInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListInt8u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command TestUnknownCommand + * Attribute ListOctetString */ -class TestClusterTestUnknownCommand : public ClusterCommand { +class ReadTestClusterListOctetString : public ReadAttribute { public: - TestClusterTestUnknownCommand() - : ClusterCommand("test-unknown-command") + ReadTestClusterListOctetString() + : ReadAttribute("list-octet-string") { - ClusterCommand::AddArguments(); } + ~ReadTestClusterListOctetString() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListOctetString response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListOctetString read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteTestClusterListOctetString : public WriteAttribute { +public: + WriteTestClusterListOctetString() + : WriteAttribute("list-octet-string") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-octet-string"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteTestClusterListOctetString() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTestUnknownCommandParams alloc] init]; - params.timedInvokeTimeoutMs + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster testUnknownCommandWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + NSData * newElement_0; + newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + [array_0 addObject:newElement_0]; + } + value = array_0; } + + [cluster writeAttributeListOctetStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListOctetString write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; }; -/* - * Command TimedInvokeRequest - */ -class TestClusterTimedInvokeRequest : public ClusterCommand { +class SubscribeAttributeTestClusterListOctetString : public SubscribeAttribute { public: - TestClusterTimedInvokeRequest() - : ClusterCommand("timed-invoke-request") + SubscribeAttributeTestClusterListOctetString() + : SubscribeAttribute("list-octet-string") { - ClusterCommand::AddArguments(); } + ~SubscribeAttributeTestClusterListOctetString() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000012) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPTestClusterClusterTimedInvokeRequestParams 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 timedInvokeRequestWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeListOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListOctetString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Attribute Boolean + * Attribute ListStructOctetString */ -class ReadTestClusterBoolean : public ReadAttribute { +class ReadTestClusterListStructOctetString : public ReadAttribute { public: - ReadTestClusterBoolean() - : ReadAttribute("boolean") + ReadTestClusterListStructOctetString() + : ReadAttribute("list-struct-octet-string") { } - ~ReadTestClusterBoolean() {} + ~ReadTestClusterListStructOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Boolean response %@", [value description]); + [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListStructOctetString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Boolean read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster ListStructOctetString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -54801,73 +77754,90 @@ class ReadTestClusterBoolean : public ReadAttribute { } }; -class WriteTestClusterBoolean : public WriteAttribute { +class WriteTestClusterListStructOctetString : public WriteAttribute { public: - WriteTestClusterBoolean() - : WriteAttribute("boolean") + WriteTestClusterListStructOctetString() + : WriteAttribute("list-struct-octet-string") + , mComplex(&mValue) { - AddArgument("attr-name", "boolean"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "list-struct-octet-string"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteTestClusterBoolean() {} + ~WriteTestClusterListStructOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPTestClusterClusterTestListStructOctet * newElement_0; + newElement_0 = [CHIPTestClusterClusterTestListStructOctet new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedLongLong:entry_0.fabricIndex]; + newElement_0.operationalCert = [NSData dataWithBytes:entry_0.operationalCert.data() + length:entry_0.operationalCert.size()]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } - [cluster writeAttributeBooleanWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Boolean write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeListStructOctetStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListStructOctetString write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + chip::app::DataModel::List mValue; + TypedComplexArgument> + mComplex; }; -class SubscribeAttributeTestClusterBoolean : public SubscribeAttribute { +class SubscribeAttributeTestClusterListStructOctetString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterBoolean() - : SubscribeAttribute("boolean") + SubscribeAttributeTestClusterListStructOctetString() + : SubscribeAttribute("list-struct-octet-string") { } - ~SubscribeAttributeTestClusterBoolean() {} + ~SubscribeAttributeTestClusterListStructOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Boolean response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeListStructOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListStructOctetString response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -54879,30 +77849,30 @@ class SubscribeAttributeTestClusterBoolean : public SubscribeAttribute { }; /* - * Attribute Bitmap8 + * Attribute LongOctetString */ -class ReadTestClusterBitmap8 : public ReadAttribute { +class ReadTestClusterLongOctetString : public ReadAttribute { public: - ReadTestClusterBitmap8() - : ReadAttribute("bitmap8") + ReadTestClusterLongOctetString() + : ReadAttribute("long-octet-string") { } - ~ReadTestClusterBitmap8() {} + ~ReadTestClusterLongOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap8 response %@", [value description]); + [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.LongOctetString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap8 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster LongOctetString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -54910,73 +77880,74 @@ class ReadTestClusterBitmap8 : public ReadAttribute { } }; -class WriteTestClusterBitmap8 : public WriteAttribute { +class WriteTestClusterLongOctetString : public WriteAttribute { public: - WriteTestClusterBitmap8() - : WriteAttribute("bitmap8") + WriteTestClusterLongOctetString() + : WriteAttribute("long-octet-string") { - AddArgument("attr-name", "bitmap8"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "long-octet-string"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterBitmap8() {} + ~WriteTestClusterLongOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + NSData * _Nonnull value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - [cluster writeAttributeBitmap8WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap8 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeLongOctetStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster LongOctetString write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint8_t mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeTestClusterBitmap8 : public SubscribeAttribute { +class SubscribeAttributeTestClusterLongOctetString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterBitmap8() - : SubscribeAttribute("bitmap8") + SubscribeAttributeTestClusterLongOctetString() + : SubscribeAttribute("long-octet-string") { } - ~SubscribeAttributeTestClusterBitmap8() {} + ~SubscribeAttributeTestClusterLongOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBitmap8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap8 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLongOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.LongOctetString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -54988,30 +77959,30 @@ class SubscribeAttributeTestClusterBitmap8 : public SubscribeAttribute { }; /* - * Attribute Bitmap16 + * Attribute CharString */ -class ReadTestClusterBitmap16 : public ReadAttribute { +class ReadTestClusterCharString : public ReadAttribute { public: - ReadTestClusterBitmap16() - : ReadAttribute("bitmap16") + ReadTestClusterCharString() + : ReadAttribute("char-string") { } - ~ReadTestClusterBitmap16() {} + ~ReadTestClusterCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap16 response %@", [value description]); + [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.CharString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap16 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster CharString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55019,73 +77990,76 @@ class ReadTestClusterBitmap16 : public ReadAttribute { } }; -class WriteTestClusterBitmap16 : public WriteAttribute { +class WriteTestClusterCharString : public WriteAttribute { public: - WriteTestClusterBitmap16() - : WriteAttribute("bitmap16") + WriteTestClusterCharString() + : WriteAttribute("char-string") { - AddArgument("attr-name", "bitmap16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); + AddArgument("attr-name", "char-string"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterBitmap16() {} + ~WriteTestClusterCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; - [cluster writeAttributeBitmap16WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap16 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster + writeAttributeCharStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster CharString write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint16_t mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeTestClusterBitmap16 : public SubscribeAttribute { +class SubscribeAttributeTestClusterCharString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterBitmap16() - : SubscribeAttribute("bitmap16") + SubscribeAttributeTestClusterCharString() + : SubscribeAttribute("char-string") { } - ~SubscribeAttributeTestClusterBitmap16() {} + ~SubscribeAttributeTestClusterCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBitmap16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap16 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeCharStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.CharString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55097,30 +78071,30 @@ class SubscribeAttributeTestClusterBitmap16 : public SubscribeAttribute { }; /* - * Attribute Bitmap32 + * Attribute LongCharString */ -class ReadTestClusterBitmap32 : public ReadAttribute { +class ReadTestClusterLongCharString : public ReadAttribute { public: - ReadTestClusterBitmap32() - : ReadAttribute("bitmap32") + ReadTestClusterLongCharString() + : ReadAttribute("long-char-string") { } - ~ReadTestClusterBitmap32() {} + ~ReadTestClusterLongCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap32 response %@", [value description]); + [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.LongCharString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap32 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster LongCharString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55128,73 +78102,76 @@ class ReadTestClusterBitmap32 : public ReadAttribute { } }; -class WriteTestClusterBitmap32 : public WriteAttribute { +class WriteTestClusterLongCharString : public WriteAttribute { public: - WriteTestClusterBitmap32() - : WriteAttribute("bitmap32") + WriteTestClusterLongCharString() + : WriteAttribute("long-char-string") { - AddArgument("attr-name", "bitmap32"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); + AddArgument("attr-name", "long-char-string"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterBitmap32() {} + ~WriteTestClusterLongCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; - [cluster writeAttributeBitmap32WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap32 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeLongCharStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster LongCharString write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint32_t mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeTestClusterBitmap32 : public SubscribeAttribute { +class SubscribeAttributeTestClusterLongCharString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterBitmap32() - : SubscribeAttribute("bitmap32") + SubscribeAttributeTestClusterLongCharString() + : SubscribeAttribute("long-char-string") { } - ~SubscribeAttributeTestClusterBitmap32() {} + ~SubscribeAttributeTestClusterLongCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBitmap32WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap32 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLongCharStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.LongCharString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55206,30 +78183,30 @@ class SubscribeAttributeTestClusterBitmap32 : public SubscribeAttribute { }; /* - * Attribute Bitmap64 + * Attribute EpochUs */ -class ReadTestClusterBitmap64 : public ReadAttribute { +class ReadTestClusterEpochUs : public ReadAttribute { public: - ReadTestClusterBitmap64() - : ReadAttribute("bitmap64") + ReadTestClusterEpochUs() + : ReadAttribute("epoch-us") { } - ~ReadTestClusterBitmap64() {} + ~ReadTestClusterEpochUs() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap64 response %@", [value description]); + [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.EpochUs response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap64 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster EpochUs read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55237,21 +78214,21 @@ class ReadTestClusterBitmap64 : public ReadAttribute { } }; -class WriteTestClusterBitmap64 : public WriteAttribute { +class WriteTestClusterEpochUs : public WriteAttribute { public: - WriteTestClusterBitmap64() - : WriteAttribute("bitmap64") + WriteTestClusterEpochUs() + : WriteAttribute("epoch-us") { - AddArgument("attr-name", "bitmap64"); + AddArgument("attr-name", "epoch-us"); AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterBitmap64() {} + ~WriteTestClusterEpochUs() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; @@ -55260,15 +78237,15 @@ class WriteTestClusterBitmap64 : public WriteAttribute { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster writeAttributeBitmap64WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Bitmap64 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeEpochUsWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster EpochUs write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -55276,34 +78253,34 @@ class WriteTestClusterBitmap64 : public WriteAttribute { uint64_t mValue; }; -class SubscribeAttributeTestClusterBitmap64 : public SubscribeAttribute { +class SubscribeAttributeTestClusterEpochUs : public SubscribeAttribute { public: - SubscribeAttributeTestClusterBitmap64() - : SubscribeAttribute("bitmap64") + SubscribeAttributeTestClusterEpochUs() + : SubscribeAttribute("epoch-us") { } - ~SubscribeAttributeTestClusterBitmap64() {} + ~SubscribeAttributeTestClusterEpochUs() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeBitmap64WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Bitmap64 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeEpochUsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.EpochUs response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55315,30 +78292,30 @@ class SubscribeAttributeTestClusterBitmap64 : public SubscribeAttribute { }; /* - * Attribute Int8u + * Attribute EpochS */ -class ReadTestClusterInt8u : public ReadAttribute { +class ReadTestClusterEpochS : public ReadAttribute { public: - ReadTestClusterInt8u() - : ReadAttribute("int8u") + ReadTestClusterEpochS() + : ReadAttribute("epoch-s") { } - ~ReadTestClusterInt8u() {} + ~ReadTestClusterEpochS() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int8u response %@", [value description]); + [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.EpochS response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int8u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster EpochS read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55346,73 +78323,73 @@ class ReadTestClusterInt8u : public ReadAttribute { } }; -class WriteTestClusterInt8u : public WriteAttribute { +class WriteTestClusterEpochS : public WriteAttribute { public: - WriteTestClusterInt8u() - : WriteAttribute("int8u") + WriteTestClusterEpochS() + : WriteAttribute("epoch-s") { - AddArgument("attr-name", "int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "epoch-s"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt8u() {} + ~WriteTestClusterEpochS() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; - [cluster writeAttributeInt8uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int8u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeEpochSWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster EpochS write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint8_t mValue; + uint32_t mValue; }; -class SubscribeAttributeTestClusterInt8u : public SubscribeAttribute { +class SubscribeAttributeTestClusterEpochS : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt8u() - : SubscribeAttribute("int8u") + SubscribeAttributeTestClusterEpochS() + : SubscribeAttribute("epoch-s") { } - ~SubscribeAttributeTestClusterInt8u() {} + ~SubscribeAttributeTestClusterEpochS() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int8u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeEpochSWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.EpochS response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55424,30 +78401,30 @@ class SubscribeAttributeTestClusterInt8u : public SubscribeAttribute { }; /* - * Attribute Int16u + * Attribute VendorId */ -class ReadTestClusterInt16u : public ReadAttribute { +class ReadTestClusterVendorId : public ReadAttribute { public: - ReadTestClusterInt16u() - : ReadAttribute("int16u") + ReadTestClusterVendorId() + : ReadAttribute("vendor-id") { } - ~ReadTestClusterInt16u() {} + ~ReadTestClusterVendorId() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int16u response %@", [value description]); + [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.VendorId response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int16u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster VendorId read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55455,21 +78432,21 @@ class ReadTestClusterInt16u : public ReadAttribute { } }; -class WriteTestClusterInt16u : public WriteAttribute { +class WriteTestClusterVendorId : public WriteAttribute { public: - WriteTestClusterInt16u() - : WriteAttribute("int16u") + WriteTestClusterVendorId() + : WriteAttribute("vendor-id") { - AddArgument("attr-name", "int16u"); + AddArgument("attr-name", "vendor-id"); AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt16u() {} + ~WriteTestClusterVendorId() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; @@ -55478,50 +78455,50 @@ class WriteTestClusterInt16u : public WriteAttribute { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeInt16uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int16u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeVendorIdWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster VendorId write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint16_t mValue; + chip::VendorId mValue; }; -class SubscribeAttributeTestClusterInt16u : public SubscribeAttribute { +class SubscribeAttributeTestClusterVendorId : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt16u() - : SubscribeAttribute("int16u") + SubscribeAttributeTestClusterVendorId() + : SubscribeAttribute("vendor-id") { } - ~SubscribeAttributeTestClusterInt16u() {} + ~SubscribeAttributeTestClusterVendorId() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int16u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeVendorIdWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.VendorId response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55533,30 +78510,31 @@ class SubscribeAttributeTestClusterInt16u : public SubscribeAttribute { }; /* - * Attribute Int24u + * Attribute ListNullablesAndOptionalsStruct */ -class ReadTestClusterInt24u : public ReadAttribute { +class ReadTestClusterListNullablesAndOptionalsStruct : public ReadAttribute { public: - ReadTestClusterInt24u() - : ReadAttribute("int24u") + ReadTestClusterListNullablesAndOptionalsStruct() + : ReadAttribute("list-nullables-and-optionals-struct") { } - ~ReadTestClusterInt24u() {} + ~ReadTestClusterListNullablesAndOptionalsStruct() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt24uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int24u response %@", [value description]); + [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( + NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListNullablesAndOptionalsStruct response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int24u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster ListNullablesAndOptionalsStruct read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55564,73 +78542,242 @@ class ReadTestClusterInt24u : public ReadAttribute { } }; -class WriteTestClusterInt24u : public WriteAttribute { +class WriteTestClusterListNullablesAndOptionalsStruct : public WriteAttribute { public: - WriteTestClusterInt24u() - : WriteAttribute("int24u") + WriteTestClusterListNullablesAndOptionalsStruct() + : WriteAttribute("list-nullables-and-optionals-struct") + , mComplex(&mValue) { - AddArgument("attr-name", "int24u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); + AddArgument("attr-name", "list-nullables-and-optionals-struct"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt24u() {} + ~WriteTestClusterListNullablesAndOptionalsStruct() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPTestClusterClusterNullablesAndOptionalsStruct * newElement_0; + newElement_0 = [CHIPTestClusterClusterNullablesAndOptionalsStruct new]; + if (entry_0.nullableInt.IsNull()) { + newElement_0.nullableInt = nil; + } else { + newElement_0.nullableInt = [NSNumber numberWithUnsignedShort:entry_0.nullableInt.Value()]; + } + if (entry_0.optionalInt.HasValue()) { + newElement_0.optionalInt = [NSNumber numberWithUnsignedShort:entry_0.optionalInt.Value()]; + } else { + newElement_0.optionalInt = nil; + } + if (entry_0.nullableOptionalInt.HasValue()) { + if (entry_0.nullableOptionalInt.Value().IsNull()) { + newElement_0.nullableOptionalInt = nil; + } else { + newElement_0.nullableOptionalInt = + [NSNumber numberWithUnsignedShort:entry_0.nullableOptionalInt.Value().Value()]; + } + } else { + newElement_0.nullableOptionalInt = nil; + } + if (entry_0.nullableString.IsNull()) { + newElement_0.nullableString = nil; + } else { + newElement_0.nullableString = [[NSString alloc] initWithBytes:entry_0.nullableString.Value().data() + length:entry_0.nullableString.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (entry_0.optionalString.HasValue()) { + newElement_0.optionalString = [[NSString alloc] initWithBytes:entry_0.optionalString.Value().data() + length:entry_0.optionalString.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + newElement_0.optionalString = nil; + } + if (entry_0.nullableOptionalString.HasValue()) { + if (entry_0.nullableOptionalString.Value().IsNull()) { + newElement_0.nullableOptionalString = nil; + } else { + newElement_0.nullableOptionalString = + [[NSString alloc] initWithBytes:entry_0.nullableOptionalString.Value().Value().data() + length:entry_0.nullableOptionalString.Value().Value().size() + encoding:NSUTF8StringEncoding]; + } + } else { + newElement_0.nullableOptionalString = nil; + } + if (entry_0.nullableStruct.IsNull()) { + newElement_0.nullableStruct = nil; + } else { + newElement_0.nullableStruct = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.nullableStruct.a = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().a]; + newElement_0.nullableStruct.b = [NSNumber numberWithBool:entry_0.nullableStruct.Value().b]; + newElement_0.nullableStruct.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableStruct.Value().c)]; + newElement_0.nullableStruct.d = [NSData dataWithBytes:entry_0.nullableStruct.Value().d.data() + length:entry_0.nullableStruct.Value().d.size()]; + newElement_0.nullableStruct.e = [[NSString alloc] initWithBytes:entry_0.nullableStruct.Value().e.data() + length:entry_0.nullableStruct.Value().e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.nullableStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().f.Raw()]; + newElement_0.nullableStruct.g = [NSNumber numberWithFloat:entry_0.nullableStruct.Value().g]; + newElement_0.nullableStruct.h = [NSNumber numberWithDouble:entry_0.nullableStruct.Value().h]; + } + if (entry_0.optionalStruct.HasValue()) { + newElement_0.optionalStruct = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.optionalStruct.a = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().a]; + newElement_0.optionalStruct.b = [NSNumber numberWithBool:entry_0.optionalStruct.Value().b]; + newElement_0.optionalStruct.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.optionalStruct.Value().c)]; + newElement_0.optionalStruct.d = [NSData dataWithBytes:entry_0.optionalStruct.Value().d.data() + length:entry_0.optionalStruct.Value().d.size()]; + newElement_0.optionalStruct.e = [[NSString alloc] initWithBytes:entry_0.optionalStruct.Value().e.data() + length:entry_0.optionalStruct.Value().e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.optionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().f.Raw()]; + newElement_0.optionalStruct.g = [NSNumber numberWithFloat:entry_0.optionalStruct.Value().g]; + newElement_0.optionalStruct.h = [NSNumber numberWithDouble:entry_0.optionalStruct.Value().h]; + } else { + newElement_0.optionalStruct = nil; + } + if (entry_0.nullableOptionalStruct.HasValue()) { + if (entry_0.nullableOptionalStruct.Value().IsNull()) { + newElement_0.nullableOptionalStruct = nil; + } else { + newElement_0.nullableOptionalStruct = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.nullableOptionalStruct.a = + [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().a]; + newElement_0.nullableOptionalStruct.b = + [NSNumber numberWithBool:entry_0.nullableOptionalStruct.Value().Value().b]; + newElement_0.nullableOptionalStruct.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableOptionalStruct.Value().Value().c)]; + newElement_0.nullableOptionalStruct.d = + [NSData dataWithBytes:entry_0.nullableOptionalStruct.Value().Value().d.data() + length:entry_0.nullableOptionalStruct.Value().Value().d.size()]; + newElement_0.nullableOptionalStruct.e = + [[NSString alloc] initWithBytes:entry_0.nullableOptionalStruct.Value().Value().e.data() + length:entry_0.nullableOptionalStruct.Value().Value().e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.nullableOptionalStruct.f = + [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().f.Raw()]; + newElement_0.nullableOptionalStruct.g = + [NSNumber numberWithFloat:entry_0.nullableOptionalStruct.Value().Value().g]; + newElement_0.nullableOptionalStruct.h = + [NSNumber numberWithDouble:entry_0.nullableOptionalStruct.Value().Value().h]; + } + } else { + newElement_0.nullableOptionalStruct = nil; + } + if (entry_0.nullableList.IsNull()) { + newElement_0.nullableList = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.nullableList.Value()) { + NSNumber * newElement_3; + newElement_3 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_3)]; + [array_3 addObject:newElement_3]; + } + newElement_0.nullableList = array_3; + } + } + if (entry_0.optionalList.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.optionalList.Value()) { + NSNumber * newElement_3; + newElement_3 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_3)]; + [array_3 addObject:newElement_3]; + } + newElement_0.optionalList = array_3; + } + } else { + newElement_0.optionalList = nil; + } + if (entry_0.nullableOptionalList.HasValue()) { + if (entry_0.nullableOptionalList.Value().IsNull()) { + newElement_0.nullableOptionalList = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : entry_0.nullableOptionalList.Value().Value()) { + NSNumber * newElement_4; + newElement_4 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_4)]; + [array_4 addObject:newElement_4]; + } + newElement_0.nullableOptionalList = array_4; + } + } + } else { + newElement_0.nullableOptionalList = nil; + } + [array_0 addObject:newElement_0]; + } + value = array_0; + } - [cluster writeAttributeInt24uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int24u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeListNullablesAndOptionalsStructWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "TestCluster ListNullablesAndOptionalsStruct write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint32_t mValue; + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; }; -class SubscribeAttributeTestClusterInt24u : public SubscribeAttribute { +class SubscribeAttributeTestClusterListNullablesAndOptionalsStruct : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt24u() - : SubscribeAttribute("int24u") + SubscribeAttributeTestClusterListNullablesAndOptionalsStruct() + : SubscribeAttribute("list-nullables-and-optionals-struct") { } - ~SubscribeAttributeTestClusterInt24u() {} + ~SubscribeAttributeTestClusterListNullablesAndOptionalsStruct() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt24uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int24u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeListNullablesAndOptionalsStructWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListNullablesAndOptionalsStruct response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55642,30 +78789,30 @@ class SubscribeAttributeTestClusterInt24u : public SubscribeAttribute { }; /* - * Attribute Int32u + * Attribute EnumAttr */ -class ReadTestClusterInt32u : public ReadAttribute { +class ReadTestClusterEnumAttr : public ReadAttribute { public: - ReadTestClusterInt32u() - : ReadAttribute("int32u") + ReadTestClusterEnumAttr() + : ReadAttribute("enum-attr") { } - ~ReadTestClusterInt32u() {} + ~ReadTestClusterEnumAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int32u response %@", [value description]); + [cluster readAttributeEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.EnumAttr response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int32u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster EnumAttr read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55673,73 +78820,73 @@ class ReadTestClusterInt32u : public ReadAttribute { } }; -class WriteTestClusterInt32u : public WriteAttribute { +class WriteTestClusterEnumAttr : public WriteAttribute { public: - WriteTestClusterInt32u() - : WriteAttribute("int32u") + WriteTestClusterEnumAttr() + : WriteAttribute("enum-attr") { - AddArgument("attr-name", "int32u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); + AddArgument("attr-name", "enum-attr"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt32u() {} + ~WriteTestClusterEnumAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeInt32uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int32u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeEnumAttrWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster EnumAttr write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint32_t mValue; + uint8_t mValue; }; -class SubscribeAttributeTestClusterInt32u : public SubscribeAttribute { +class SubscribeAttributeTestClusterEnumAttr : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt32u() - : SubscribeAttribute("int32u") + SubscribeAttributeTestClusterEnumAttr() + : SubscribeAttribute("enum-attr") { } - ~SubscribeAttributeTestClusterInt32u() {} + ~SubscribeAttributeTestClusterEnumAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt32uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int32u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeEnumAttrWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.EnumAttr response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55751,30 +78898,31 @@ class SubscribeAttributeTestClusterInt32u : public SubscribeAttribute { }; /* - * Attribute Int40u + * Attribute StructAttr */ -class ReadTestClusterInt40u : public ReadAttribute { +class ReadTestClusterStructAttr : public ReadAttribute { public: - ReadTestClusterInt40u() - : ReadAttribute("int40u") + ReadTestClusterStructAttr() + : ReadAttribute("struct-attr") { } - ~ReadTestClusterInt40u() {} + ~ReadTestClusterStructAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt40uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int40u response %@", [value description]); + [cluster readAttributeStructAttrWithCompletionHandler:^( + CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.StructAttr response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int40u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster StructAttr read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55782,73 +78930,86 @@ class ReadTestClusterInt40u : public ReadAttribute { } }; -class WriteTestClusterInt40u : public WriteAttribute { +class WriteTestClusterStructAttr : public WriteAttribute { public: - WriteTestClusterInt40u() - : WriteAttribute("int40u") + WriteTestClusterStructAttr() + : WriteAttribute("struct-attr") + , mComplex(&mValue) { - AddArgument("attr-name", "int40u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); + AddArgument("attr-name", "struct-attr"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt40u() {} + ~WriteTestClusterStructAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + CHIPTestClusterClusterSimpleStruct * _Nonnull value; + value = [CHIPTestClusterClusterSimpleStruct new]; + value.a = [NSNumber numberWithUnsignedChar:mValue.a]; + value.b = [NSNumber numberWithBool:mValue.b]; + value.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.c)]; + value.d = [NSData dataWithBytes:mValue.d.data() length:mValue.d.size()]; + value.e = [[NSString alloc] initWithBytes:mValue.e.data() length:mValue.e.size() encoding:NSUTF8StringEncoding]; + value.f = [NSNumber numberWithUnsignedChar:mValue.f.Raw()]; + value.g = [NSNumber numberWithFloat:mValue.g]; + value.h = [NSNumber numberWithDouble:mValue.h]; - [cluster writeAttributeInt40uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int40u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster + writeAttributeStructAttrWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster StructAttr write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint64_t mValue; + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type mValue; + TypedComplexArgument mComplex; }; -class SubscribeAttributeTestClusterInt40u : public SubscribeAttribute { +class SubscribeAttributeTestClusterStructAttr : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt40u() - : SubscribeAttribute("int40u") + SubscribeAttributeTestClusterStructAttr() + : SubscribeAttribute("struct-attr") { } - ~SubscribeAttributeTestClusterInt40u() {} + ~SubscribeAttributeTestClusterStructAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt40uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int40u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeStructAttrWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error) { + NSLog(@"TestCluster.StructAttr response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55860,30 +79021,30 @@ class SubscribeAttributeTestClusterInt40u : public SubscribeAttribute { }; /* - * Attribute Int48u + * Attribute RangeRestrictedInt8u */ -class ReadTestClusterInt48u : public ReadAttribute { +class ReadTestClusterRangeRestrictedInt8u : public ReadAttribute { public: - ReadTestClusterInt48u() - : ReadAttribute("int48u") + ReadTestClusterRangeRestrictedInt8u() + : ReadAttribute("range-restricted-int8u") { } - ~ReadTestClusterInt48u() {} + ~ReadTestClusterRangeRestrictedInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt48uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int48u response %@", [value description]); + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt8u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int48u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster RangeRestrictedInt8u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -55891,73 +79052,75 @@ class ReadTestClusterInt48u : public ReadAttribute { } }; -class WriteTestClusterInt48u : public WriteAttribute { -public: - WriteTestClusterInt48u() - : WriteAttribute("int48u") +class WriteTestClusterRangeRestrictedInt8u : public WriteAttribute { +public: + WriteTestClusterRangeRestrictedInt8u() + : WriteAttribute("range-restricted-int8u") { - AddArgument("attr-name", "int48u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); + AddArgument("attr-name", "range-restricted-int8u"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt48u() {} + ~WriteTestClusterRangeRestrictedInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeInt48uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int48u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster RangeRestrictedInt8u write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint64_t mValue; + uint8_t mValue; }; -class SubscribeAttributeTestClusterInt48u : public SubscribeAttribute { +class SubscribeAttributeTestClusterRangeRestrictedInt8u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt48u() - : SubscribeAttribute("int48u") + SubscribeAttributeTestClusterRangeRestrictedInt8u() + : SubscribeAttribute("range-restricted-int8u") { } - ~SubscribeAttributeTestClusterInt48u() {} + ~SubscribeAttributeTestClusterRangeRestrictedInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt48uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int48u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRangeRestrictedInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt8u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -55969,30 +79132,30 @@ class SubscribeAttributeTestClusterInt48u : public SubscribeAttribute { }; /* - * Attribute Int56u + * Attribute RangeRestrictedInt8s */ -class ReadTestClusterInt56u : public ReadAttribute { +class ReadTestClusterRangeRestrictedInt8s : public ReadAttribute { public: - ReadTestClusterInt56u() - : ReadAttribute("int56u") + ReadTestClusterRangeRestrictedInt8s() + : ReadAttribute("range-restricted-int8s") { } - ~ReadTestClusterInt56u() {} + ~ReadTestClusterRangeRestrictedInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt56uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int56u response %@", [value description]); + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt8s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int56u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster RangeRestrictedInt8s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56000,73 +79163,75 @@ class ReadTestClusterInt56u : public ReadAttribute { } }; -class WriteTestClusterInt56u : public WriteAttribute { +class WriteTestClusterRangeRestrictedInt8s : public WriteAttribute { public: - WriteTestClusterInt56u() - : WriteAttribute("int56u") + WriteTestClusterRangeRestrictedInt8s() + : WriteAttribute("range-restricted-int8s") { - AddArgument("attr-name", "int56u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); + AddArgument("attr-name", "range-restricted-int8s"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt56u() {} + ~WriteTestClusterRangeRestrictedInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; - [cluster writeAttributeInt56uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int56u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster RangeRestrictedInt8s write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint64_t mValue; + int8_t mValue; }; -class SubscribeAttributeTestClusterInt56u : public SubscribeAttribute { +class SubscribeAttributeTestClusterRangeRestrictedInt8s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt56u() - : SubscribeAttribute("int56u") + SubscribeAttributeTestClusterRangeRestrictedInt8s() + : SubscribeAttribute("range-restricted-int8s") { } - ~SubscribeAttributeTestClusterInt56u() {} + ~SubscribeAttributeTestClusterRangeRestrictedInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt56uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int56u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeRangeRestrictedInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt8s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56078,30 +79243,30 @@ class SubscribeAttributeTestClusterInt56u : public SubscribeAttribute { }; /* - * Attribute Int64u + * Attribute RangeRestrictedInt16u */ -class ReadTestClusterInt64u : public ReadAttribute { +class ReadTestClusterRangeRestrictedInt16u : public ReadAttribute { public: - ReadTestClusterInt64u() - : ReadAttribute("int64u") + ReadTestClusterRangeRestrictedInt16u() + : ReadAttribute("range-restricted-int16u") { } - ~ReadTestClusterInt64u() {} + ~ReadTestClusterRangeRestrictedInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int64u response %@", [value description]); + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt16u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int64u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster RangeRestrictedInt16u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56109,73 +79274,75 @@ class ReadTestClusterInt64u : public ReadAttribute { } }; -class WriteTestClusterInt64u : public WriteAttribute { +class WriteTestClusterRangeRestrictedInt16u : public WriteAttribute { public: - WriteTestClusterInt64u() - : WriteAttribute("int64u") + WriteTestClusterRangeRestrictedInt16u() + : WriteAttribute("range-restricted-int16u") { - AddArgument("attr-name", "int64u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); + AddArgument("attr-name", "range-restricted-int16u"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt64u() {} + ~WriteTestClusterRangeRestrictedInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeInt64uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int64u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster RangeRestrictedInt16u write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint64_t mValue; + uint16_t mValue; }; -class SubscribeAttributeTestClusterInt64u : public SubscribeAttribute { +class SubscribeAttributeTestClusterRangeRestrictedInt16u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt64u() - : SubscribeAttribute("int64u") + SubscribeAttributeTestClusterRangeRestrictedInt16u() + : SubscribeAttribute("range-restricted-int16u") { } - ~SubscribeAttributeTestClusterInt64u() {} + ~SubscribeAttributeTestClusterRangeRestrictedInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt64uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int64u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRangeRestrictedInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt16u response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56187,30 +79354,30 @@ class SubscribeAttributeTestClusterInt64u : public SubscribeAttribute { }; /* - * Attribute Int8s + * Attribute RangeRestrictedInt16s */ -class ReadTestClusterInt8s : public ReadAttribute { +class ReadTestClusterRangeRestrictedInt16s : public ReadAttribute { public: - ReadTestClusterInt8s() - : ReadAttribute("int8s") + ReadTestClusterRangeRestrictedInt16s() + : ReadAttribute("range-restricted-int16s") { } - ~ReadTestClusterInt8s() {} + ~ReadTestClusterRangeRestrictedInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int8s response %@", [value description]); + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt16s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int8s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster RangeRestrictedInt16s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56218,73 +79385,75 @@ class ReadTestClusterInt8s : public ReadAttribute { } }; -class WriteTestClusterInt8s : public WriteAttribute { +class WriteTestClusterRangeRestrictedInt16s : public WriteAttribute { public: - WriteTestClusterInt8s() - : WriteAttribute("int8s") + WriteTestClusterRangeRestrictedInt16s() + : WriteAttribute("range-restricted-int16s") { - AddArgument("attr-name", "int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + AddArgument("attr-name", "range-restricted-int16s"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt8s() {} + ~WriteTestClusterRangeRestrictedInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeInt8sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int8s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster RangeRestrictedInt16s write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int8_t mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterInt8s : public SubscribeAttribute { +class SubscribeAttributeTestClusterRangeRestrictedInt16s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt8s() - : SubscribeAttribute("int8s") + SubscribeAttributeTestClusterRangeRestrictedInt16s() + : SubscribeAttribute("range-restricted-int16s") { } - ~SubscribeAttributeTestClusterInt8s() {} + ~SubscribeAttributeTestClusterRangeRestrictedInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int8s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRangeRestrictedInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.RangeRestrictedInt16s response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56296,30 +79465,30 @@ class SubscribeAttributeTestClusterInt8s : public SubscribeAttribute { }; /* - * Attribute Int16s + * Attribute ListLongOctetString */ -class ReadTestClusterInt16s : public ReadAttribute { +class ReadTestClusterListLongOctetString : public ReadAttribute { public: - ReadTestClusterInt16s() - : ReadAttribute("int16s") + ReadTestClusterListLongOctetString() + : ReadAttribute("list-long-octet-string") { } - ~ReadTestClusterInt16s() {} + ~ReadTestClusterListLongOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000002A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int16s response %@", [value description]); + [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListLongOctetString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int16s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster ListLongOctetString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56327,73 +79496,86 @@ class ReadTestClusterInt16s : public ReadAttribute { } }; -class WriteTestClusterInt16s : public WriteAttribute { +class WriteTestClusterListLongOctetString : public WriteAttribute { public: - WriteTestClusterInt16s() - : WriteAttribute("int16s") + WriteTestClusterListLongOctetString() + : WriteAttribute("list-long-octet-string") + , mComplex(&mValue) { - AddArgument("attr-name", "int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "list-long-octet-string"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt16s() {} + ~WriteTestClusterListLongOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000002A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + NSData * newElement_0; + newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } - [cluster writeAttributeInt16sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int16s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeListLongOctetStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListLongOctetString write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; }; -class SubscribeAttributeTestClusterInt16s : public SubscribeAttribute { +class SubscribeAttributeTestClusterListLongOctetString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt16s() - : SubscribeAttribute("int16s") + SubscribeAttributeTestClusterListLongOctetString() + : SubscribeAttribute("list-long-octet-string") { } - ~SubscribeAttributeTestClusterInt16s() {} + ~SubscribeAttributeTestClusterListLongOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000002A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int16s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeListLongOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListLongOctetString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56405,104 +79587,170 @@ class SubscribeAttributeTestClusterInt16s : public SubscribeAttribute { }; /* - * Attribute Int24s + * Attribute ListFabricScoped */ -class ReadTestClusterInt24s : public ReadAttribute { +class ReadTestClusterListFabricScoped : public ReadAttribute { public: - ReadTestClusterInt24s() - : ReadAttribute("int24s") + ReadTestClusterListFabricScoped() + : ReadAttribute("list-fabric-scoped") { } - ~ReadTestClusterInt24s() {} + ~ReadTestClusterListFabricScoped() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000002B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt24sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int24s response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + CHIPReadParams * params = [[CHIPReadParams alloc] init]; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster readAttributeListFabricScopedWithParams:params + completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListFabricScoped response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int24s read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster ListFabricScoped read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterInt24s : public WriteAttribute { +class WriteTestClusterListFabricScoped : public WriteAttribute { public: - WriteTestClusterInt24s() - : WriteAttribute("int24s") + WriteTestClusterListFabricScoped() + : WriteAttribute("list-fabric-scoped") + , mComplex(&mValue) { - AddArgument("attr-name", "int24s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); + AddArgument("attr-name", "list-fabric-scoped"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt24s() {} + ~WriteTestClusterListFabricScoped() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000002B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithInt:mValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPTestClusterClusterTestFabricScoped * newElement_0; + newElement_0 = [CHIPTestClusterClusterTestFabricScoped new]; + newElement_0.fabricSensitiveInt8u = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveInt8u]; + if (entry_0.optionalFabricSensitiveInt8u.HasValue()) { + newElement_0.optionalFabricSensitiveInt8u = + [NSNumber numberWithUnsignedChar:entry_0.optionalFabricSensitiveInt8u.Value()]; + } else { + newElement_0.optionalFabricSensitiveInt8u = nil; + } + if (entry_0.nullableFabricSensitiveInt8u.IsNull()) { + newElement_0.nullableFabricSensitiveInt8u = nil; + } else { + newElement_0.nullableFabricSensitiveInt8u = + [NSNumber numberWithUnsignedChar:entry_0.nullableFabricSensitiveInt8u.Value()]; + } + if (entry_0.nullableOptionalFabricSensitiveInt8u.HasValue()) { + if (entry_0.nullableOptionalFabricSensitiveInt8u.Value().IsNull()) { + newElement_0.nullableOptionalFabricSensitiveInt8u = nil; + } else { + newElement_0.nullableOptionalFabricSensitiveInt8u = + [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalFabricSensitiveInt8u.Value().Value()]; + } + } else { + newElement_0.nullableOptionalFabricSensitiveInt8u = nil; + } + newElement_0.fabricSensitiveCharString = [[NSString alloc] initWithBytes:entry_0.fabricSensitiveCharString.data() + length:entry_0.fabricSensitiveCharString.size() + encoding:NSUTF8StringEncoding]; + newElement_0.fabricSensitiveStruct = [CHIPTestClusterClusterSimpleStruct new]; + newElement_0.fabricSensitiveStruct.a = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.a]; + newElement_0.fabricSensitiveStruct.b = [NSNumber numberWithBool:entry_0.fabricSensitiveStruct.b]; + newElement_0.fabricSensitiveStruct.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.fabricSensitiveStruct.c)]; + newElement_0.fabricSensitiveStruct.d = [NSData dataWithBytes:entry_0.fabricSensitiveStruct.d.data() + length:entry_0.fabricSensitiveStruct.d.size()]; + newElement_0.fabricSensitiveStruct.e = [[NSString alloc] initWithBytes:entry_0.fabricSensitiveStruct.e.data() + length:entry_0.fabricSensitiveStruct.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.fabricSensitiveStruct.f = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.f.Raw()]; + newElement_0.fabricSensitiveStruct.g = [NSNumber numberWithFloat:entry_0.fabricSensitiveStruct.g]; + newElement_0.fabricSensitiveStruct.h = [NSNumber numberWithDouble:entry_0.fabricSensitiveStruct.h]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.fabricSensitiveInt8uList) { + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; + [array_2 addObject:newElement_2]; + } + newElement_0.fabricSensitiveInt8uList = array_2; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } - [cluster writeAttributeInt24sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int24s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeListFabricScopedWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster ListFabricScoped write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int32_t mValue; + chip::app::DataModel::List mValue; + TypedComplexArgument> + mComplex; }; -class SubscribeAttributeTestClusterInt24s : public SubscribeAttribute { +class SubscribeAttributeTestClusterListFabricScoped : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt24s() - : SubscribeAttribute("int24s") + SubscribeAttributeTestClusterListFabricScoped() + : SubscribeAttribute("list-fabric-scoped") { } - ~SubscribeAttributeTestClusterInt24s() {} + ~SubscribeAttributeTestClusterListFabricScoped() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000002B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt24sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int24s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeListFabricScopedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ListFabricScoped response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56514,30 +79762,30 @@ class SubscribeAttributeTestClusterInt24s : public SubscribeAttribute { }; /* - * Attribute Int32s + * Attribute TimedWriteBoolean */ -class ReadTestClusterInt32s : public ReadAttribute { +class ReadTestClusterTimedWriteBoolean : public ReadAttribute { public: - ReadTestClusterInt32s() - : ReadAttribute("int32s") + ReadTestClusterTimedWriteBoolean() + : ReadAttribute("timed-write-boolean") { } - ~ReadTestClusterInt32s() {} + ~ReadTestClusterTimedWriteBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int32s response %@", [value description]); + [cluster readAttributeTimedWriteBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.TimedWriteBoolean response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int32s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster TimedWriteBoolean read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56545,73 +79793,74 @@ class ReadTestClusterInt32s : public ReadAttribute { } }; -class WriteTestClusterInt32s : public WriteAttribute { +class WriteTestClusterTimedWriteBoolean : public WriteAttribute { public: - WriteTestClusterInt32s() - : WriteAttribute("int32s") + WriteTestClusterTimedWriteBoolean() + : WriteAttribute("timed-write-boolean") { - AddArgument("attr-name", "int32s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); + AddArgument("attr-name", "timed-write-boolean"); + AddArgument("attr-value", 0, 1, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt32s() {} + ~WriteTestClusterTimedWriteBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithInt:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeInt32sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int32s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeTimedWriteBooleanWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster TimedWriteBoolean write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int32_t mValue; + bool mValue; }; -class SubscribeAttributeTestClusterInt32s : public SubscribeAttribute { +class SubscribeAttributeTestClusterTimedWriteBoolean : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt32s() - : SubscribeAttribute("int32s") + SubscribeAttributeTestClusterTimedWriteBoolean() + : SubscribeAttribute("timed-write-boolean") { } - ~SubscribeAttributeTestClusterInt32s() {} + ~SubscribeAttributeTestClusterTimedWriteBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt32sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int32s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeTimedWriteBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.TimedWriteBoolean response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56623,30 +79872,30 @@ class SubscribeAttributeTestClusterInt32s : public SubscribeAttribute { }; /* - * Attribute Int40s + * Attribute GeneralErrorBoolean */ -class ReadTestClusterInt40s : public ReadAttribute { +class ReadTestClusterGeneralErrorBoolean : public ReadAttribute { public: - ReadTestClusterInt40s() - : ReadAttribute("int40s") + ReadTestClusterGeneralErrorBoolean() + : ReadAttribute("general-error-boolean") { } - ~ReadTestClusterInt40s() {} + ~ReadTestClusterGeneralErrorBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt40sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int40s response %@", [value description]); + [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.GeneralErrorBoolean response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int40s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster GeneralErrorBoolean read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56654,73 +79903,75 @@ class ReadTestClusterInt40s : public ReadAttribute { } }; -class WriteTestClusterInt40s : public WriteAttribute { +class WriteTestClusterGeneralErrorBoolean : public WriteAttribute { public: - WriteTestClusterInt40s() - : WriteAttribute("int40s") + WriteTestClusterGeneralErrorBoolean() + : WriteAttribute("general-error-boolean") { - AddArgument("attr-name", "int40s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + AddArgument("attr-name", "general-error-boolean"); + AddArgument("attr-value", 0, 1, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt40s() {} + ~WriteTestClusterGeneralErrorBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeInt40sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int40s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeGeneralErrorBooleanWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster GeneralErrorBoolean write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int64_t mValue; + bool mValue; }; -class SubscribeAttributeTestClusterInt40s : public SubscribeAttribute { +class SubscribeAttributeTestClusterGeneralErrorBoolean : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt40s() - : SubscribeAttribute("int40s") + SubscribeAttributeTestClusterGeneralErrorBoolean() + : SubscribeAttribute("general-error-boolean") { } - ~SubscribeAttributeTestClusterInt40s() {} + ~SubscribeAttributeTestClusterGeneralErrorBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt40sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int40s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeGeneralErrorBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.GeneralErrorBoolean response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56732,30 +79983,30 @@ class SubscribeAttributeTestClusterInt40s : public SubscribeAttribute { }; /* - * Attribute Int48s + * Attribute ClusterErrorBoolean */ -class ReadTestClusterInt48s : public ReadAttribute { +class ReadTestClusterClusterErrorBoolean : public ReadAttribute { public: - ReadTestClusterInt48s() - : ReadAttribute("int48s") + ReadTestClusterClusterErrorBoolean() + : ReadAttribute("cluster-error-boolean") { } - ~ReadTestClusterInt48s() {} + ~ReadTestClusterClusterErrorBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt48sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int48s response %@", [value description]); + [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ClusterErrorBoolean response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int48s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster ClusterErrorBoolean read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56763,73 +80014,75 @@ class ReadTestClusterInt48s : public ReadAttribute { } }; -class WriteTestClusterInt48s : public WriteAttribute { +class WriteTestClusterClusterErrorBoolean : public WriteAttribute { public: - WriteTestClusterInt48s() - : WriteAttribute("int48s") + WriteTestClusterClusterErrorBoolean() + : WriteAttribute("cluster-error-boolean") { - AddArgument("attr-name", "int48s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + AddArgument("attr-name", "cluster-error-boolean"); + AddArgument("attr-value", 0, 1, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt48s() {} + ~WriteTestClusterClusterErrorBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeInt48sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int48s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeClusterErrorBooleanWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster ClusterErrorBoolean write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int64_t mValue; + bool mValue; }; -class SubscribeAttributeTestClusterInt48s : public SubscribeAttribute { +class SubscribeAttributeTestClusterClusterErrorBoolean : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt48s() - : SubscribeAttribute("int48s") + SubscribeAttributeTestClusterClusterErrorBoolean() + : SubscribeAttribute("cluster-error-boolean") { } - ~SubscribeAttributeTestClusterInt48s() {} + ~SubscribeAttributeTestClusterClusterErrorBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt48sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int48s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeClusterErrorBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ClusterErrorBoolean response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56841,30 +80094,30 @@ class SubscribeAttributeTestClusterInt48s : public SubscribeAttribute { }; /* - * Attribute Int56s + * Attribute Unsupported */ -class ReadTestClusterInt56s : public ReadAttribute { +class ReadTestClusterUnsupported : public ReadAttribute { public: - ReadTestClusterInt56s() - : ReadAttribute("int56s") + ReadTestClusterUnsupported() + : ReadAttribute("unsupported") { } - ~ReadTestClusterInt56s() {} + ~ReadTestClusterUnsupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x000000FF) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt56sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int56s response %@", [value description]); + [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Unsupported response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int56s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster Unsupported read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56872,35 +80125,36 @@ class ReadTestClusterInt56s : public ReadAttribute { } }; -class WriteTestClusterInt56s : public WriteAttribute { +class WriteTestClusterUnsupported : public WriteAttribute { public: - WriteTestClusterInt56s() - : WriteAttribute("int56s") + WriteTestClusterUnsupported() + : WriteAttribute("unsupported") { - AddArgument("attr-name", "int56s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + AddArgument("attr-name", "unsupported"); + AddArgument("attr-value", 0, 1, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt56s() {} + ~WriteTestClusterUnsupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x000000FF) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeInt56sWithValue:value + [cluster + writeAttributeUnsupportedWithValue:value params:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int56s write Error: %s", chip::ErrorStr(chipError)); + ChipLogError(chipTool, "TestCluster Unsupported write Error: %s", chip::ErrorStr(chipError)); } SetCommandExitStatus(chipError); }]; @@ -56908,37 +80162,37 @@ class WriteTestClusterInt56s : public WriteAttribute { } private: - int64_t mValue; + bool mValue; }; -class SubscribeAttributeTestClusterInt56s : public SubscribeAttribute { +class SubscribeAttributeTestClusterUnsupported : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt56s() - : SubscribeAttribute("int56s") + SubscribeAttributeTestClusterUnsupported() + : SubscribeAttribute("unsupported") { } - ~SubscribeAttributeTestClusterInt56s() {} + ~SubscribeAttributeTestClusterUnsupported() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x000000FF) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt56sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int56s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeUnsupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.Unsupported response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -56950,30 +80204,30 @@ class SubscribeAttributeTestClusterInt56s : public SubscribeAttribute { }; /* - * Attribute Int64s + * Attribute NullableBoolean */ -class ReadTestClusterInt64s : public ReadAttribute { +class ReadTestClusterNullableBoolean : public ReadAttribute { public: - ReadTestClusterInt64s() - : ReadAttribute("int64s") + ReadTestClusterNullableBoolean() + : ReadAttribute("nullable-boolean") { } - ~ReadTestClusterInt64s() {} + ~ReadTestClusterNullableBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int64s response %@", [value description]); + [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBoolean response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Int64s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableBoolean read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -56981,73 +80235,74 @@ class ReadTestClusterInt64s : public ReadAttribute { } }; -class WriteTestClusterInt64s : public WriteAttribute { +class WriteTestClusterNullableBoolean : public WriteAttribute { public: - WriteTestClusterInt64s() - : WriteAttribute("int64s") + WriteTestClusterNullableBoolean() + : WriteAttribute("nullable-boolean") { - AddArgument("attr-name", "int64s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + AddArgument("attr-name", "nullable-boolean"); + AddArgument("attr-value", 0, 1, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterInt64s() {} + ~WriteTestClusterNullableBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeInt64sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Int64s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableBooleanWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableBoolean write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int64_t mValue; + bool mValue; }; -class SubscribeAttributeTestClusterInt64s : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableBoolean : public SubscribeAttribute { public: - SubscribeAttributeTestClusterInt64s() - : SubscribeAttribute("int64s") + SubscribeAttributeTestClusterNullableBoolean() + : SubscribeAttribute("nullable-boolean") { } - ~SubscribeAttributeTestClusterInt64s() {} + ~SubscribeAttributeTestClusterNullableBoolean() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeInt64sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Int64s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBoolean response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57059,30 +80314,30 @@ class SubscribeAttributeTestClusterInt64s : public SubscribeAttribute { }; /* - * Attribute Enum8 + * Attribute NullableBitmap8 */ -class ReadTestClusterEnum8 : public ReadAttribute { +class ReadTestClusterNullableBitmap8 : public ReadAttribute { public: - ReadTestClusterEnum8() - : ReadAttribute("enum8") + ReadTestClusterNullableBitmap8() + : ReadAttribute("nullable-bitmap8") { } - ~ReadTestClusterEnum8() {} + ~ReadTestClusterNullableBitmap8() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Enum8 response %@", [value description]); + [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap8 response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Enum8 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableBitmap8 read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57090,38 +80345,39 @@ class ReadTestClusterEnum8 : public ReadAttribute { } }; -class WriteTestClusterEnum8 : public WriteAttribute { +class WriteTestClusterNullableBitmap8 : public WriteAttribute { public: - WriteTestClusterEnum8() - : WriteAttribute("enum8") + WriteTestClusterNullableBitmap8() + : WriteAttribute("nullable-bitmap8") { - AddArgument("attr-name", "enum8"); + AddArgument("attr-name", "nullable-bitmap8"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterEnum8() {} + ~WriteTestClusterNullableBitmap8() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeEnum8WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Enum8 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableBitmap8WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableBitmap8 write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -57129,34 +80385,34 @@ class WriteTestClusterEnum8 : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeTestClusterEnum8 : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableBitmap8 : public SubscribeAttribute { public: - SubscribeAttributeTestClusterEnum8() - : SubscribeAttribute("enum8") + SubscribeAttributeTestClusterNullableBitmap8() + : SubscribeAttribute("nullable-bitmap8") { } - ~SubscribeAttributeTestClusterEnum8() {} + ~SubscribeAttributeTestClusterNullableBitmap8() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEnum8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Enum8 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableBitmap8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap8 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57168,30 +80424,30 @@ class SubscribeAttributeTestClusterEnum8 : public SubscribeAttribute { }; /* - * Attribute Enum16 + * Attribute NullableBitmap16 */ -class ReadTestClusterEnum16 : public ReadAttribute { +class ReadTestClusterNullableBitmap16 : public ReadAttribute { public: - ReadTestClusterEnum16() - : ReadAttribute("enum16") + ReadTestClusterNullableBitmap16() + : ReadAttribute("nullable-bitmap16") { } - ~ReadTestClusterEnum16() {} + ~ReadTestClusterNullableBitmap16() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Enum16 response %@", [value description]); + [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap16 response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Enum16 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableBitmap16 read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57199,38 +80455,39 @@ class ReadTestClusterEnum16 : public ReadAttribute { } }; -class WriteTestClusterEnum16 : public WriteAttribute { +class WriteTestClusterNullableBitmap16 : public WriteAttribute { public: - WriteTestClusterEnum16() - : WriteAttribute("enum16") + WriteTestClusterNullableBitmap16() + : WriteAttribute("nullable-bitmap16") { - AddArgument("attr-name", "enum16"); + AddArgument("attr-name", "nullable-bitmap16"); AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterEnum16() {} + ~WriteTestClusterNullableBitmap16() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeEnum16WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Enum16 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableBitmap16WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableBitmap16 write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -57238,34 +80495,34 @@ class WriteTestClusterEnum16 : public WriteAttribute { uint16_t mValue; }; -class SubscribeAttributeTestClusterEnum16 : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableBitmap16 : public SubscribeAttribute { public: - SubscribeAttributeTestClusterEnum16() - : SubscribeAttribute("enum16") + SubscribeAttributeTestClusterNullableBitmap16() + : SubscribeAttribute("nullable-bitmap16") { } - ~SubscribeAttributeTestClusterEnum16() {} + ~SubscribeAttributeTestClusterNullableBitmap16() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEnum16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Enum16 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableBitmap16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap16 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57277,30 +80534,30 @@ class SubscribeAttributeTestClusterEnum16 : public SubscribeAttribute { }; /* - * Attribute FloatSingle + * Attribute NullableBitmap32 */ -class ReadTestClusterFloatSingle : public ReadAttribute { +class ReadTestClusterNullableBitmap32 : public ReadAttribute { public: - ReadTestClusterFloatSingle() - : ReadAttribute("float-single") + ReadTestClusterNullableBitmap32() + : ReadAttribute("nullable-bitmap32") { } - ~ReadTestClusterFloatSingle() {} + ~ReadTestClusterNullableBitmap32() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.FloatSingle response %@", [value description]); + [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap32 response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster FloatSingle read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableBitmap32 read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57308,74 +80565,74 @@ class ReadTestClusterFloatSingle : public ReadAttribute { } }; -class WriteTestClusterFloatSingle : public WriteAttribute { +class WriteTestClusterNullableBitmap32 : public WriteAttribute { public: - WriteTestClusterFloatSingle() - : WriteAttribute("float-single") + WriteTestClusterNullableBitmap32() + : WriteAttribute("nullable-bitmap32") { - AddArgument("attr-name", "float-single"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); + AddArgument("attr-name", "nullable-bitmap32"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterFloatSingle() {} + ~WriteTestClusterNullableBitmap32() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithFloat:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; - [cluster - writeAttributeFloatSingleWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster FloatSingle write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableBitmap32WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableBitmap32 write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - float mValue; + uint32_t mValue; }; -class SubscribeAttributeTestClusterFloatSingle : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableBitmap32 : public SubscribeAttribute { public: - SubscribeAttributeTestClusterFloatSingle() - : SubscribeAttribute("float-single") + SubscribeAttributeTestClusterNullableBitmap32() + : SubscribeAttribute("nullable-bitmap32") { } - ~SubscribeAttributeTestClusterFloatSingle() {} + ~SubscribeAttributeTestClusterNullableBitmap32() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFloatSingleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.FloatSingle response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableBitmap32WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap32 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57387,30 +80644,30 @@ class SubscribeAttributeTestClusterFloatSingle : public SubscribeAttribute { }; /* - * Attribute FloatDouble + * Attribute NullableBitmap64 */ -class ReadTestClusterFloatDouble : public ReadAttribute { +class ReadTestClusterNullableBitmap64 : public ReadAttribute { public: - ReadTestClusterFloatDouble() - : ReadAttribute("float-double") + ReadTestClusterNullableBitmap64() + : ReadAttribute("nullable-bitmap64") { } - ~ReadTestClusterFloatDouble() {} + ~ReadTestClusterNullableBitmap64() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.FloatDouble response %@", [value description]); + [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap64 response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster FloatDouble read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableBitmap64 read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57418,74 +80675,74 @@ class ReadTestClusterFloatDouble : public ReadAttribute { } }; -class WriteTestClusterFloatDouble : public WriteAttribute { +class WriteTestClusterNullableBitmap64 : public WriteAttribute { public: - WriteTestClusterFloatDouble() - : WriteAttribute("float-double") + WriteTestClusterNullableBitmap64() + : WriteAttribute("nullable-bitmap64") { - AddArgument("attr-name", "float-double"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); + AddArgument("attr-name", "nullable-bitmap64"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterFloatDouble() {} + ~WriteTestClusterNullableBitmap64() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithDouble:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster - writeAttributeFloatDoubleWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster FloatDouble write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableBitmap64WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableBitmap64 write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - double mValue; + uint64_t mValue; }; -class SubscribeAttributeTestClusterFloatDouble : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableBitmap64 : public SubscribeAttribute { public: - SubscribeAttributeTestClusterFloatDouble() - : SubscribeAttribute("float-double") + SubscribeAttributeTestClusterNullableBitmap64() + : SubscribeAttribute("nullable-bitmap64") { } - ~SubscribeAttributeTestClusterFloatDouble() {} + ~SubscribeAttributeTestClusterNullableBitmap64() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeFloatDoubleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.FloatDouble response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableBitmap64WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableBitmap64 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57497,30 +80754,30 @@ class SubscribeAttributeTestClusterFloatDouble : public SubscribeAttribute { }; /* - * Attribute OctetString + * Attribute NullableInt8u */ -class ReadTestClusterOctetString : public ReadAttribute { +class ReadTestClusterNullableInt8u : public ReadAttribute { public: - ReadTestClusterOctetString() - : ReadAttribute("octet-string") + ReadTestClusterNullableInt8u() + : ReadAttribute("nullable-int8u") { } - ~ReadTestClusterOctetString() {} + ~ReadTestClusterNullableInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.OctetString response %@", [value description]); + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt8u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster OctetString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt8u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57528,74 +80785,74 @@ class ReadTestClusterOctetString : public ReadAttribute { } }; -class WriteTestClusterOctetString : public WriteAttribute { +class WriteTestClusterNullableInt8u : public WriteAttribute { public: - WriteTestClusterOctetString() - : WriteAttribute("octet-string") + WriteTestClusterNullableInt8u() + : WriteAttribute("nullable-int8u") { - AddArgument("attr-name", "octet-string"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "nullable-int8u"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterOctetString() {} + ~WriteTestClusterNullableInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSData * _Nonnull value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeOctetStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster OctetString write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt8uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt8u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mValue; + uint8_t mValue; }; -class SubscribeAttributeTestClusterOctetString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt8u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterOctetString() - : SubscribeAttribute("octet-string") + SubscribeAttributeTestClusterNullableInt8u() + : SubscribeAttribute("nullable-int8u") { } - ~SubscribeAttributeTestClusterOctetString() {} + ~SubscribeAttributeTestClusterNullableInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.OctetString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt8u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57607,30 +80864,30 @@ class SubscribeAttributeTestClusterOctetString : public SubscribeAttribute { }; /* - * Attribute ListInt8u + * Attribute NullableInt16u */ -class ReadTestClusterListInt8u : public ReadAttribute { +class ReadTestClusterNullableInt16u : public ReadAttribute { public: - ReadTestClusterListInt8u() - : ReadAttribute("list-int8u") + ReadTestClusterNullableInt16u() + : ReadAttribute("nullable-int16u") { } - ~ReadTestClusterListInt8u() {} + ~ReadTestClusterNullableInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListInt8u response %@", [value description]); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt16u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ListInt8u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt16u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57638,84 +80895,74 @@ class ReadTestClusterListInt8u : public ReadAttribute { } }; -class WriteTestClusterListInt8u : public WriteAttribute { +class WriteTestClusterNullableInt16u : public WriteAttribute { public: - WriteTestClusterListInt8u() - : WriteAttribute("list-int8u") - , mComplex(&mValue) + WriteTestClusterNullableInt16u() + : WriteAttribute("nullable-int16u") { - AddArgument("attr-name", "list-int8u"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "nullable-int16u"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterListInt8u() {} + ~WriteTestClusterNullableInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeListInt8uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster ListInt8u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt16uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt16u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; + uint16_t mValue; }; -class SubscribeAttributeTestClusterListInt8u : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt16u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterListInt8u() - : SubscribeAttribute("list-int8u") + SubscribeAttributeTestClusterNullableInt16u() + : SubscribeAttribute("nullable-int16u") { } - ~SubscribeAttributeTestClusterListInt8u() {} + ~SubscribeAttributeTestClusterNullableInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeListInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListInt8u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt16u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57727,30 +80974,30 @@ class SubscribeAttributeTestClusterListInt8u : public SubscribeAttribute { }; /* - * Attribute ListOctetString + * Attribute NullableInt24u */ -class ReadTestClusterListOctetString : public ReadAttribute { +class ReadTestClusterNullableInt24u : public ReadAttribute { public: - ReadTestClusterListOctetString() - : ReadAttribute("list-octet-string") + ReadTestClusterNullableInt24u() + : ReadAttribute("nullable-int24u") { } - ~ReadTestClusterListOctetString() {} + ~ReadTestClusterNullableInt24u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeListOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListOctetString response %@", [value description]); + [cluster readAttributeNullableInt24uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt24u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ListOctetString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt24u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57758,85 +81005,74 @@ class ReadTestClusterListOctetString : public ReadAttribute { } }; -class WriteTestClusterListOctetString : public WriteAttribute { +class WriteTestClusterNullableInt24u : public WriteAttribute { public: - WriteTestClusterListOctetString() - : WriteAttribute("list-octet-string") - , mComplex(&mValue) + WriteTestClusterNullableInt24u() + : WriteAttribute("nullable-int24u") { - AddArgument("attr-name", "list-octet-string"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "nullable-int24u"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterListOctetString() {} + ~WriteTestClusterNullableInt24u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; - [cluster writeAttributeListOctetStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster ListOctetString write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt24uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt24u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; + uint32_t mValue; }; -class SubscribeAttributeTestClusterListOctetString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt24u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterListOctetString() - : SubscribeAttribute("list-octet-string") + SubscribeAttributeTestClusterNullableInt24u() + : SubscribeAttribute("nullable-int24u") { } - ~SubscribeAttributeTestClusterListOctetString() {} + ~SubscribeAttributeTestClusterNullableInt24u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeListOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListOctetString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt24uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt24u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57848,30 +81084,30 @@ class SubscribeAttributeTestClusterListOctetString : public SubscribeAttribute { }; /* - * Attribute ListStructOctetString + * Attribute NullableInt32u */ -class ReadTestClusterListStructOctetString : public ReadAttribute { +class ReadTestClusterNullableInt32u : public ReadAttribute { public: - ReadTestClusterListStructOctetString() - : ReadAttribute("list-struct-octet-string") + ReadTestClusterNullableInt32u() + : ReadAttribute("nullable-int32u") { } - ~ReadTestClusterListStructOctetString() {} + ~ReadTestClusterNullableInt32u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeListStructOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListStructOctetString response %@", [value description]); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt32u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ListStructOctetString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt32u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -57879,90 +81115,74 @@ class ReadTestClusterListStructOctetString : public ReadAttribute { } }; -class WriteTestClusterListStructOctetString : public WriteAttribute { +class WriteTestClusterNullableInt32u : public WriteAttribute { public: - WriteTestClusterListStructOctetString() - : WriteAttribute("list-struct-octet-string") - , mComplex(&mValue) + WriteTestClusterNullableInt32u() + : WriteAttribute("nullable-int32u") { - AddArgument("attr-name", "list-struct-octet-string"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "nullable-int32u"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterListStructOctetString() {} + ~WriteTestClusterNullableInt32u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - CHIPTestClusterClusterTestListStructOctet * newElement_0; - newElement_0 = [CHIPTestClusterClusterTestListStructOctet new]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedLongLong:entry_0.fabricIndex]; - newElement_0.operationalCert = [NSData dataWithBytes:entry_0.operationalCert.data() - length:entry_0.operationalCert.size()]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; - [cluster writeAttributeListStructOctetStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster ListStructOctetString write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt32uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt32u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::List mValue; - TypedComplexArgument> - mComplex; + uint32_t mValue; }; -class SubscribeAttributeTestClusterListStructOctetString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt32u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterListStructOctetString() - : SubscribeAttribute("list-struct-octet-string") + SubscribeAttributeTestClusterNullableInt32u() + : SubscribeAttribute("nullable-int32u") { } - ~SubscribeAttributeTestClusterListStructOctetString() {} + ~SubscribeAttributeTestClusterNullableInt32u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeListStructOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListStructOctetString response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt32uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt32u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -57974,30 +81194,30 @@ class SubscribeAttributeTestClusterListStructOctetString : public SubscribeAttri }; /* - * Attribute LongOctetString + * Attribute NullableInt40u */ -class ReadTestClusterLongOctetString : public ReadAttribute { +class ReadTestClusterNullableInt40u : public ReadAttribute { public: - ReadTestClusterLongOctetString() - : ReadAttribute("long-octet-string") + ReadTestClusterNullableInt40u() + : ReadAttribute("nullable-int40u") { } - ~ReadTestClusterLongOctetString() {} + ~ReadTestClusterNullableInt40u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLongOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.LongOctetString response %@", [value description]); + [cluster readAttributeNullableInt40uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt40u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster LongOctetString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt40u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58005,74 +81225,74 @@ class ReadTestClusterLongOctetString : public ReadAttribute { } }; -class WriteTestClusterLongOctetString : public WriteAttribute { +class WriteTestClusterNullableInt40u : public WriteAttribute { public: - WriteTestClusterLongOctetString() - : WriteAttribute("long-octet-string") + WriteTestClusterNullableInt40u() + : WriteAttribute("nullable-int40u") { - AddArgument("attr-name", "long-octet-string"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "nullable-int40u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterLongOctetString() {} + ~WriteTestClusterNullableInt40u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSData * _Nonnull value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster writeAttributeLongOctetStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster LongOctetString write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt40uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt40u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mValue; + uint64_t mValue; }; -class SubscribeAttributeTestClusterLongOctetString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt40u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterLongOctetString() - : SubscribeAttribute("long-octet-string") + SubscribeAttributeTestClusterNullableInt40u() + : SubscribeAttribute("nullable-int40u") { } - ~SubscribeAttributeTestClusterLongOctetString() {} + ~SubscribeAttributeTestClusterNullableInt40u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLongOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.LongOctetString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt40uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt40u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -58084,30 +81304,30 @@ class SubscribeAttributeTestClusterLongOctetString : public SubscribeAttribute { }; /* - * Attribute CharString + * Attribute NullableInt48u */ -class ReadTestClusterCharString : public ReadAttribute { +class ReadTestClusterNullableInt48u : public ReadAttribute { public: - ReadTestClusterCharString() - : ReadAttribute("char-string") + ReadTestClusterNullableInt48u() + : ReadAttribute("nullable-int48u") { } - ~ReadTestClusterCharString() {} + ~ReadTestClusterNullableInt48u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.CharString response %@", [value description]); + [cluster readAttributeNullableInt48uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt48u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster CharString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt48u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58115,76 +81335,74 @@ class ReadTestClusterCharString : public ReadAttribute { } }; -class WriteTestClusterCharString : public WriteAttribute { +class WriteTestClusterNullableInt48u : public WriteAttribute { public: - WriteTestClusterCharString() - : WriteAttribute("char-string") + WriteTestClusterNullableInt48u() + : WriteAttribute("nullable-int48u") { - AddArgument("attr-name", "char-string"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "nullable-int48u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterCharString() {} + ~WriteTestClusterNullableInt48u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster - writeAttributeCharStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster CharString write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt48uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt48u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mValue; + uint64_t mValue; }; -class SubscribeAttributeTestClusterCharString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt48u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterCharString() - : SubscribeAttribute("char-string") + SubscribeAttributeTestClusterNullableInt48u() + : SubscribeAttribute("nullable-int48u") { } - ~SubscribeAttributeTestClusterCharString() {} + ~SubscribeAttributeTestClusterNullableInt48u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeCharStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.CharString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt48uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt48u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -58196,30 +81414,30 @@ class SubscribeAttributeTestClusterCharString : public SubscribeAttribute { }; /* - * Attribute LongCharString + * Attribute NullableInt56u */ -class ReadTestClusterLongCharString : public ReadAttribute { +class ReadTestClusterNullableInt56u : public ReadAttribute { public: - ReadTestClusterLongCharString() - : ReadAttribute("long-char-string") + ReadTestClusterNullableInt56u() + : ReadAttribute("nullable-int56u") { } - ~ReadTestClusterLongCharString() {} + ~ReadTestClusterNullableInt56u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLongCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.LongCharString response %@", [value description]); + [cluster readAttributeNullableInt56uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt56u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster LongCharString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt56u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58227,38 +81445,36 @@ class ReadTestClusterLongCharString : public ReadAttribute { } }; -class WriteTestClusterLongCharString : public WriteAttribute { +class WriteTestClusterNullableInt56u : public WriteAttribute { public: - WriteTestClusterLongCharString() - : WriteAttribute("long-char-string") + WriteTestClusterNullableInt56u() + : WriteAttribute("nullable-int56u") { - AddArgument("attr-name", "long-char-string"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "nullable-int56u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterLongCharString() {} + ~WriteTestClusterNullableInt56u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster writeAttributeLongCharStringWithValue:value + [cluster writeAttributeNullableInt56uWithValue:value params:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { ChipLogError( - chipTool, "TestCluster LongCharString write Error: %s", chip::ErrorStr(chipError)); + chipTool, "TestCluster NullableInt56u write Error: %s", chip::ErrorStr(chipError)); } SetCommandExitStatus(chipError); }]; @@ -58266,33 +81482,33 @@ class WriteTestClusterLongCharString : public WriteAttribute { } private: - chip::ByteSpan mValue; + uint64_t mValue; }; -class SubscribeAttributeTestClusterLongCharString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt56u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterLongCharString() - : SubscribeAttribute("long-char-string") + SubscribeAttributeTestClusterNullableInt56u() + : SubscribeAttribute("nullable-int56u") { } - ~SubscribeAttributeTestClusterLongCharString() {} + ~SubscribeAttributeTestClusterNullableInt56u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLongCharStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeNullableInt56uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.LongCharString response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt56u response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -58308,30 +81524,30 @@ class SubscribeAttributeTestClusterLongCharString : public SubscribeAttribute { }; /* - * Attribute EpochUs + * Attribute NullableInt64u */ -class ReadTestClusterEpochUs : public ReadAttribute { +class ReadTestClusterNullableInt64u : public ReadAttribute { public: - ReadTestClusterEpochUs() - : ReadAttribute("epoch-us") + ReadTestClusterNullableInt64u() + : ReadAttribute("nullable-int64u") { } - ~ReadTestClusterEpochUs() {} + ~ReadTestClusterNullableInt64u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEpochUsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.EpochUs response %@", [value description]); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt64u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster EpochUs read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt64u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58339,38 +81555,39 @@ class ReadTestClusterEpochUs : public ReadAttribute { } }; -class WriteTestClusterEpochUs : public WriteAttribute { +class WriteTestClusterNullableInt64u : public WriteAttribute { public: - WriteTestClusterEpochUs() - : WriteAttribute("epoch-us") + WriteTestClusterNullableInt64u() + : WriteAttribute("nullable-int64u") { - AddArgument("attr-name", "epoch-us"); + AddArgument("attr-name", "nullable-int64u"); AddArgument("attr-value", 0, UINT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterEpochUs() {} + ~WriteTestClusterNullableInt64u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster writeAttributeEpochUsWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster EpochUs write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt64uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt64u write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -58378,34 +81595,34 @@ class WriteTestClusterEpochUs : public WriteAttribute { uint64_t mValue; }; -class SubscribeAttributeTestClusterEpochUs : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt64u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterEpochUs() - : SubscribeAttribute("epoch-us") + SubscribeAttributeTestClusterNullableInt64u() + : SubscribeAttribute("nullable-int64u") { } - ~SubscribeAttributeTestClusterEpochUs() {} + ~SubscribeAttributeTestClusterNullableInt64u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEpochUsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.EpochUs response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt64uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt64u response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -58417,30 +81634,30 @@ class SubscribeAttributeTestClusterEpochUs : public SubscribeAttribute { }; /* - * Attribute EpochS + * Attribute NullableInt8s */ -class ReadTestClusterEpochS : public ReadAttribute { +class ReadTestClusterNullableInt8s : public ReadAttribute { public: - ReadTestClusterEpochS() - : ReadAttribute("epoch-s") + ReadTestClusterNullableInt8s() + : ReadAttribute("nullable-int8s") { } - ~ReadTestClusterEpochS() {} + ~ReadTestClusterNullableInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEpochSWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.EpochS response %@", [value description]); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt8s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster EpochS read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt8s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58448,73 +81665,74 @@ class ReadTestClusterEpochS : public ReadAttribute { } }; -class WriteTestClusterEpochS : public WriteAttribute { +class WriteTestClusterNullableInt8s : public WriteAttribute { public: - WriteTestClusterEpochS() - : WriteAttribute("epoch-s") + WriteTestClusterNullableInt8s() + : WriteAttribute("nullable-int8s") { - AddArgument("attr-name", "epoch-s"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); + AddArgument("attr-name", "nullable-int8s"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterEpochS() {} + ~WriteTestClusterNullableInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; - [cluster writeAttributeEpochSWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster EpochS write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt8sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt8s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint32_t mValue; + int8_t mValue; }; -class SubscribeAttributeTestClusterEpochS : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt8s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterEpochS() - : SubscribeAttribute("epoch-s") + SubscribeAttributeTestClusterNullableInt8s() + : SubscribeAttribute("nullable-int8s") { } - ~SubscribeAttributeTestClusterEpochS() {} + ~SubscribeAttributeTestClusterNullableInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEpochSWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.EpochS response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt8s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -58526,30 +81744,30 @@ class SubscribeAttributeTestClusterEpochS : public SubscribeAttribute { }; /* - * Attribute VendorId + * Attribute NullableInt16s */ -class ReadTestClusterVendorId : public ReadAttribute { +class ReadTestClusterNullableInt16s : public ReadAttribute { public: - ReadTestClusterVendorId() - : ReadAttribute("vendor-id") + ReadTestClusterNullableInt16s() + : ReadAttribute("nullable-int16s") { } - ~ReadTestClusterVendorId() {} + ~ReadTestClusterNullableInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.VendorId response %@", [value description]); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt16s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster VendorId read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt16s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58557,73 +81775,74 @@ class ReadTestClusterVendorId : public ReadAttribute { } }; -class WriteTestClusterVendorId : public WriteAttribute { +class WriteTestClusterNullableInt16s : public WriteAttribute { public: - WriteTestClusterVendorId() - : WriteAttribute("vendor-id") + WriteTestClusterNullableInt16s() + : WriteAttribute("nullable-int16s") { - AddArgument("attr-name", "vendor-id"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); + AddArgument("attr-name", "nullable-int16s"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterVendorId() {} + ~WriteTestClusterNullableInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeVendorIdWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster VendorId write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt16sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt16s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::VendorId mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterVendorId : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt16s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterVendorId() - : SubscribeAttribute("vendor-id") + SubscribeAttributeTestClusterNullableInt16s() + : SubscribeAttribute("nullable-int16s") { } - ~SubscribeAttributeTestClusterVendorId() {} + ~SubscribeAttributeTestClusterNullableInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeVendorIdWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.VendorId response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt16s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -58635,31 +81854,30 @@ class SubscribeAttributeTestClusterVendorId : public SubscribeAttribute { }; /* - * Attribute ListNullablesAndOptionalsStruct + * Attribute NullableInt24s */ -class ReadTestClusterListNullablesAndOptionalsStruct : public ReadAttribute { +class ReadTestClusterNullableInt24s : public ReadAttribute { public: - ReadTestClusterListNullablesAndOptionalsStruct() - : ReadAttribute("list-nullables-and-optionals-struct") + ReadTestClusterNullableInt24s() + : ReadAttribute("nullable-int24s") { } - ~ReadTestClusterListNullablesAndOptionalsStruct() {} + ~ReadTestClusterNullableInt24s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000023) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeListNullablesAndOptionalsStructWithCompletionHandler:^( - NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListNullablesAndOptionalsStruct response %@", [value description]); + [cluster readAttributeNullableInt24sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt24s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ListNullablesAndOptionalsStruct read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt24s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58667,242 +81885,74 @@ class ReadTestClusterListNullablesAndOptionalsStruct : public ReadAttribute { } }; -class WriteTestClusterListNullablesAndOptionalsStruct : public WriteAttribute { +class WriteTestClusterNullableInt24s : public WriteAttribute { public: - WriteTestClusterListNullablesAndOptionalsStruct() - : WriteAttribute("list-nullables-and-optionals-struct") - , mComplex(&mValue) + WriteTestClusterNullableInt24s() + : WriteAttribute("nullable-int24s") { - AddArgument("attr-name", "list-nullables-and-optionals-struct"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "nullable-int24s"); + AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterListNullablesAndOptionalsStruct() {} + ~WriteTestClusterNullableInt24s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000023) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - CHIPTestClusterClusterNullablesAndOptionalsStruct * newElement_0; - newElement_0 = [CHIPTestClusterClusterNullablesAndOptionalsStruct new]; - if (entry_0.nullableInt.IsNull()) { - newElement_0.nullableInt = nil; - } else { - newElement_0.nullableInt = [NSNumber numberWithUnsignedShort:entry_0.nullableInt.Value()]; - } - if (entry_0.optionalInt.HasValue()) { - newElement_0.optionalInt = [NSNumber numberWithUnsignedShort:entry_0.optionalInt.Value()]; - } else { - newElement_0.optionalInt = nil; - } - if (entry_0.nullableOptionalInt.HasValue()) { - if (entry_0.nullableOptionalInt.Value().IsNull()) { - newElement_0.nullableOptionalInt = nil; - } else { - newElement_0.nullableOptionalInt = - [NSNumber numberWithUnsignedShort:entry_0.nullableOptionalInt.Value().Value()]; - } - } else { - newElement_0.nullableOptionalInt = nil; - } - if (entry_0.nullableString.IsNull()) { - newElement_0.nullableString = nil; - } else { - newElement_0.nullableString = [[NSString alloc] initWithBytes:entry_0.nullableString.Value().data() - length:entry_0.nullableString.Value().size() - encoding:NSUTF8StringEncoding]; - } - if (entry_0.optionalString.HasValue()) { - newElement_0.optionalString = [[NSString alloc] initWithBytes:entry_0.optionalString.Value().data() - length:entry_0.optionalString.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - newElement_0.optionalString = nil; - } - if (entry_0.nullableOptionalString.HasValue()) { - if (entry_0.nullableOptionalString.Value().IsNull()) { - newElement_0.nullableOptionalString = nil; - } else { - newElement_0.nullableOptionalString = - [[NSString alloc] initWithBytes:entry_0.nullableOptionalString.Value().Value().data() - length:entry_0.nullableOptionalString.Value().Value().size() - encoding:NSUTF8StringEncoding]; - } - } else { - newElement_0.nullableOptionalString = nil; - } - if (entry_0.nullableStruct.IsNull()) { - newElement_0.nullableStruct = nil; - } else { - newElement_0.nullableStruct = [CHIPTestClusterClusterSimpleStruct new]; - newElement_0.nullableStruct.a = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().a]; - newElement_0.nullableStruct.b = [NSNumber numberWithBool:entry_0.nullableStruct.Value().b]; - newElement_0.nullableStruct.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableStruct.Value().c)]; - newElement_0.nullableStruct.d = [NSData dataWithBytes:entry_0.nullableStruct.Value().d.data() - length:entry_0.nullableStruct.Value().d.size()]; - newElement_0.nullableStruct.e = [[NSString alloc] initWithBytes:entry_0.nullableStruct.Value().e.data() - length:entry_0.nullableStruct.Value().e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.nullableStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().f.Raw()]; - newElement_0.nullableStruct.g = [NSNumber numberWithFloat:entry_0.nullableStruct.Value().g]; - newElement_0.nullableStruct.h = [NSNumber numberWithDouble:entry_0.nullableStruct.Value().h]; - } - if (entry_0.optionalStruct.HasValue()) { - newElement_0.optionalStruct = [CHIPTestClusterClusterSimpleStruct new]; - newElement_0.optionalStruct.a = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().a]; - newElement_0.optionalStruct.b = [NSNumber numberWithBool:entry_0.optionalStruct.Value().b]; - newElement_0.optionalStruct.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.optionalStruct.Value().c)]; - newElement_0.optionalStruct.d = [NSData dataWithBytes:entry_0.optionalStruct.Value().d.data() - length:entry_0.optionalStruct.Value().d.size()]; - newElement_0.optionalStruct.e = [[NSString alloc] initWithBytes:entry_0.optionalStruct.Value().e.data() - length:entry_0.optionalStruct.Value().e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.optionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().f.Raw()]; - newElement_0.optionalStruct.g = [NSNumber numberWithFloat:entry_0.optionalStruct.Value().g]; - newElement_0.optionalStruct.h = [NSNumber numberWithDouble:entry_0.optionalStruct.Value().h]; - } else { - newElement_0.optionalStruct = nil; - } - if (entry_0.nullableOptionalStruct.HasValue()) { - if (entry_0.nullableOptionalStruct.Value().IsNull()) { - newElement_0.nullableOptionalStruct = nil; - } else { - newElement_0.nullableOptionalStruct = [CHIPTestClusterClusterSimpleStruct new]; - newElement_0.nullableOptionalStruct.a = - [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().a]; - newElement_0.nullableOptionalStruct.b = - [NSNumber numberWithBool:entry_0.nullableOptionalStruct.Value().Value().b]; - newElement_0.nullableOptionalStruct.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableOptionalStruct.Value().Value().c)]; - newElement_0.nullableOptionalStruct.d = - [NSData dataWithBytes:entry_0.nullableOptionalStruct.Value().Value().d.data() - length:entry_0.nullableOptionalStruct.Value().Value().d.size()]; - newElement_0.nullableOptionalStruct.e = - [[NSString alloc] initWithBytes:entry_0.nullableOptionalStruct.Value().Value().e.data() - length:entry_0.nullableOptionalStruct.Value().Value().e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.nullableOptionalStruct.f = - [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().f.Raw()]; - newElement_0.nullableOptionalStruct.g = - [NSNumber numberWithFloat:entry_0.nullableOptionalStruct.Value().Value().g]; - newElement_0.nullableOptionalStruct.h = - [NSNumber numberWithDouble:entry_0.nullableOptionalStruct.Value().Value().h]; - } - } else { - newElement_0.nullableOptionalStruct = nil; - } - if (entry_0.nullableList.IsNull()) { - newElement_0.nullableList = nil; - } else { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - for (auto & entry_3 : entry_0.nullableList.Value()) { - NSNumber * newElement_3; - newElement_3 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_3)]; - [array_3 addObject:newElement_3]; - } - newElement_0.nullableList = array_3; - } - } - if (entry_0.optionalList.HasValue()) { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - for (auto & entry_3 : entry_0.optionalList.Value()) { - NSNumber * newElement_3; - newElement_3 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_3)]; - [array_3 addObject:newElement_3]; - } - newElement_0.optionalList = array_3; - } - } else { - newElement_0.optionalList = nil; - } - if (entry_0.nullableOptionalList.HasValue()) { - if (entry_0.nullableOptionalList.Value().IsNull()) { - newElement_0.nullableOptionalList = nil; - } else { - { // Scope for our temporary variables - auto * array_4 = [NSMutableArray new]; - for (auto & entry_4 : entry_0.nullableOptionalList.Value().Value()) { - NSNumber * newElement_4; - newElement_4 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_4)]; - [array_4 addObject:newElement_4]; - } - newElement_0.nullableOptionalList = array_4; - } - } - } else { - newElement_0.nullableOptionalList = nil; - } - [array_0 addObject:newElement_0]; - } - value = array_0; - } + NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; - [cluster writeAttributeListNullablesAndOptionalsStructWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "TestCluster ListNullablesAndOptionalsStruct write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt24sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt24s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::List mValue; - TypedComplexArgument< - chip::app::DataModel::List> - mComplex; + int32_t mValue; }; -class SubscribeAttributeTestClusterListNullablesAndOptionalsStruct : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt24s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterListNullablesAndOptionalsStruct() - : SubscribeAttribute("list-nullables-and-optionals-struct") + SubscribeAttributeTestClusterNullableInt24s() + : SubscribeAttribute("nullable-int24s") { } - ~SubscribeAttributeTestClusterListNullablesAndOptionalsStruct() {} + ~SubscribeAttributeTestClusterNullableInt24s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000023) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeListNullablesAndOptionalsStructWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListNullablesAndOptionalsStruct response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt24sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt24s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -58914,30 +81964,30 @@ class SubscribeAttributeTestClusterListNullablesAndOptionalsStruct : public Subs }; /* - * Attribute EnumAttr + * Attribute NullableInt32s */ -class ReadTestClusterEnumAttr : public ReadAttribute { +class ReadTestClusterNullableInt32s : public ReadAttribute { public: - ReadTestClusterEnumAttr() - : ReadAttribute("enum-attr") + ReadTestClusterNullableInt32s() + : ReadAttribute("nullable-int32s") { } - ~ReadTestClusterEnumAttr() {} + ~ReadTestClusterNullableInt32s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.EnumAttr response %@", [value description]); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt32s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster EnumAttr read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt32s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -58945,73 +81995,74 @@ class ReadTestClusterEnumAttr : public ReadAttribute { } }; -class WriteTestClusterEnumAttr : public WriteAttribute { +class WriteTestClusterNullableInt32s : public WriteAttribute { public: - WriteTestClusterEnumAttr() - : WriteAttribute("enum-attr") + WriteTestClusterNullableInt32s() + : WriteAttribute("nullable-int32s") { - AddArgument("attr-name", "enum-attr"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "nullable-int32s"); + AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterEnumAttr() {} + ~WriteTestClusterNullableInt32s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; - [cluster writeAttributeEnumAttrWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster EnumAttr write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt32sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt32s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint8_t mValue; + int32_t mValue; }; -class SubscribeAttributeTestClusterEnumAttr : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt32s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterEnumAttr() - : SubscribeAttribute("enum-attr") + SubscribeAttributeTestClusterNullableInt32s() + : SubscribeAttribute("nullable-int32s") { } - ~SubscribeAttributeTestClusterEnumAttr() {} + ~SubscribeAttributeTestClusterNullableInt32s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeEnumAttrWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.EnumAttr response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt32sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt32s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59023,31 +82074,30 @@ class SubscribeAttributeTestClusterEnumAttr : public SubscribeAttribute { }; /* - * Attribute StructAttr + * Attribute NullableInt40s */ -class ReadTestClusterStructAttr : public ReadAttribute { +class ReadTestClusterNullableInt40s : public ReadAttribute { public: - ReadTestClusterStructAttr() - : ReadAttribute("struct-attr") + ReadTestClusterNullableInt40s() + : ReadAttribute("nullable-int40s") { } - ~ReadTestClusterStructAttr() {} + ~ReadTestClusterNullableInt40s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStructAttrWithCompletionHandler:^( - CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.StructAttr response %@", [value description]); + [cluster readAttributeNullableInt40sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt40s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster StructAttr read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt40s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59055,86 +82105,74 @@ class ReadTestClusterStructAttr : public ReadAttribute { } }; -class WriteTestClusterStructAttr : public WriteAttribute { +class WriteTestClusterNullableInt40s : public WriteAttribute { public: - WriteTestClusterStructAttr() - : WriteAttribute("struct-attr") - , mComplex(&mValue) - { - AddArgument("attr-name", "struct-attr"); - AddArgument("attr-value", &mComplex); + WriteTestClusterNullableInt40s() + : WriteAttribute("nullable-int40s") + { + AddArgument("attr-name", "nullable-int40s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterStructAttr() {} + ~WriteTestClusterNullableInt40s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - CHIPTestClusterClusterSimpleStruct * _Nonnull value; - value = [CHIPTestClusterClusterSimpleStruct new]; - value.a = [NSNumber numberWithUnsignedChar:mValue.a]; - value.b = [NSNumber numberWithBool:mValue.b]; - value.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.c)]; - value.d = [NSData dataWithBytes:mValue.d.data() length:mValue.d.size()]; - value.e = [[NSString alloc] initWithBytes:mValue.e.data() length:mValue.e.size() encoding:NSUTF8StringEncoding]; - value.f = [NSNumber numberWithUnsignedChar:mValue.f.Raw()]; - value.g = [NSNumber numberWithFloat:mValue.g]; - value.h = [NSNumber numberWithDouble:mValue.h]; + NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - [cluster - writeAttributeStructAttrWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster StructAttr write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt40sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt40s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type mValue; - TypedComplexArgument mComplex; + int64_t mValue; }; -class SubscribeAttributeTestClusterStructAttr : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt40s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterStructAttr() - : SubscribeAttribute("struct-attr") + SubscribeAttributeTestClusterNullableInt40s() + : SubscribeAttribute("nullable-int40s") { } - ~SubscribeAttributeTestClusterStructAttr() {} + ~SubscribeAttributeTestClusterNullableInt40s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStructAttrWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(CHIPTestClusterClusterSimpleStruct * _Nullable value, - NSError * _Nullable error) { - NSLog(@"TestCluster.StructAttr response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt40sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt40s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59146,30 +82184,30 @@ class SubscribeAttributeTestClusterStructAttr : public SubscribeAttribute { }; /* - * Attribute RangeRestrictedInt8u + * Attribute NullableInt48s */ -class ReadTestClusterRangeRestrictedInt8u : public ReadAttribute { +class ReadTestClusterNullableInt48s : public ReadAttribute { public: - ReadTestClusterRangeRestrictedInt8u() - : ReadAttribute("range-restricted-int8u") + ReadTestClusterNullableInt48s() + : ReadAttribute("nullable-int48s") { } - ~ReadTestClusterRangeRestrictedInt8u() {} + ~ReadTestClusterNullableInt48s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt8u response %@", [value description]); + [cluster readAttributeNullableInt48sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt48s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt8u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt48s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59177,75 +82215,74 @@ class ReadTestClusterRangeRestrictedInt8u : public ReadAttribute { } }; -class WriteTestClusterRangeRestrictedInt8u : public WriteAttribute { +class WriteTestClusterNullableInt48s : public WriteAttribute { public: - WriteTestClusterRangeRestrictedInt8u() - : WriteAttribute("range-restricted-int8u") + WriteTestClusterNullableInt48s() + : WriteAttribute("nullable-int48s") { - AddArgument("attr-name", "range-restricted-int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "nullable-int48s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterRangeRestrictedInt8u() {} + ~WriteTestClusterNullableInt48s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - [cluster writeAttributeRangeRestrictedInt8uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt8u write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt48sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt48s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint8_t mValue; + int64_t mValue; }; -class SubscribeAttributeTestClusterRangeRestrictedInt8u : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt48s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterRangeRestrictedInt8u() - : SubscribeAttribute("range-restricted-int8u") + SubscribeAttributeTestClusterNullableInt48s() + : SubscribeAttribute("nullable-int48s") { } - ~SubscribeAttributeTestClusterRangeRestrictedInt8u() {} + ~SubscribeAttributeTestClusterNullableInt48s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeRangeRestrictedInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt8u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt48sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt48s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59257,30 +82294,30 @@ class SubscribeAttributeTestClusterRangeRestrictedInt8u : public SubscribeAttrib }; /* - * Attribute RangeRestrictedInt8s + * Attribute NullableInt56s */ -class ReadTestClusterRangeRestrictedInt8s : public ReadAttribute { +class ReadTestClusterNullableInt56s : public ReadAttribute { public: - ReadTestClusterRangeRestrictedInt8s() - : ReadAttribute("range-restricted-int8s") + ReadTestClusterNullableInt56s() + : ReadAttribute("nullable-int56s") { } - ~ReadTestClusterRangeRestrictedInt8s() {} + ~ReadTestClusterNullableInt56s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000027) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt8s response %@", [value description]); + [cluster readAttributeNullableInt56sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt56s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt8s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt56s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59288,75 +82325,74 @@ class ReadTestClusterRangeRestrictedInt8s : public ReadAttribute { } }; -class WriteTestClusterRangeRestrictedInt8s : public WriteAttribute { +class WriteTestClusterNullableInt56s : public WriteAttribute { public: - WriteTestClusterRangeRestrictedInt8s() - : WriteAttribute("range-restricted-int8s") + WriteTestClusterNullableInt56s() + : WriteAttribute("nullable-int56s") { - AddArgument("attr-name", "range-restricted-int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + AddArgument("attr-name", "nullable-int56s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterRangeRestrictedInt8s() {} + ~WriteTestClusterNullableInt56s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000027) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - [cluster writeAttributeRangeRestrictedInt8sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt8s write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt56sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt56s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int8_t mValue; + int64_t mValue; }; -class SubscribeAttributeTestClusterRangeRestrictedInt8s : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt56s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterRangeRestrictedInt8s() - : SubscribeAttribute("range-restricted-int8s") + SubscribeAttributeTestClusterNullableInt56s() + : SubscribeAttribute("nullable-int56s") { } - ~SubscribeAttributeTestClusterRangeRestrictedInt8s() {} + ~SubscribeAttributeTestClusterNullableInt56s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000027) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeRangeRestrictedInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt8s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt56sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt56s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59368,30 +82404,30 @@ class SubscribeAttributeTestClusterRangeRestrictedInt8s : public SubscribeAttrib }; /* - * Attribute RangeRestrictedInt16u + * Attribute NullableInt64s */ -class ReadTestClusterRangeRestrictedInt16u : public ReadAttribute { +class ReadTestClusterNullableInt64s : public ReadAttribute { public: - ReadTestClusterRangeRestrictedInt16u() - : ReadAttribute("range-restricted-int16u") + ReadTestClusterNullableInt64s() + : ReadAttribute("nullable-int64s") { } - ~ReadTestClusterRangeRestrictedInt16u() {} + ~ReadTestClusterNullableInt64s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000028) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt16u response %@", [value description]); + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt64s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt16u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableInt64s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59399,75 +82435,74 @@ class ReadTestClusterRangeRestrictedInt16u : public ReadAttribute { } }; -class WriteTestClusterRangeRestrictedInt16u : public WriteAttribute { +class WriteTestClusterNullableInt64s : public WriteAttribute { public: - WriteTestClusterRangeRestrictedInt16u() - : WriteAttribute("range-restricted-int16u") + WriteTestClusterNullableInt64s() + : WriteAttribute("nullable-int64s") { - AddArgument("attr-name", "range-restricted-int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); + AddArgument("attr-name", "nullable-int64s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterRangeRestrictedInt16u() {} + ~WriteTestClusterNullableInt64s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000028) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - [cluster writeAttributeRangeRestrictedInt16uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt16u write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableInt64sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableInt64s write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint16_t mValue; + int64_t mValue; }; -class SubscribeAttributeTestClusterRangeRestrictedInt16u : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableInt64s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterRangeRestrictedInt16u() - : SubscribeAttribute("range-restricted-int16u") + SubscribeAttributeTestClusterNullableInt64s() + : SubscribeAttribute("nullable-int64s") { } - ~SubscribeAttributeTestClusterRangeRestrictedInt16u() {} + ~SubscribeAttributeTestClusterNullableInt64s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000028) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRangeRestrictedInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt16u response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableInt64sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableInt64s response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59479,30 +82514,30 @@ class SubscribeAttributeTestClusterRangeRestrictedInt16u : public SubscribeAttri }; /* - * Attribute RangeRestrictedInt16s + * Attribute NullableEnum8 */ -class ReadTestClusterRangeRestrictedInt16s : public ReadAttribute { +class ReadTestClusterNullableEnum8 : public ReadAttribute { public: - ReadTestClusterRangeRestrictedInt16s() - : ReadAttribute("range-restricted-int16s") + ReadTestClusterNullableEnum8() + : ReadAttribute("nullable-enum8") { } - ~ReadTestClusterRangeRestrictedInt16s() {} + ~ReadTestClusterNullableEnum8() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt16s response %@", [value description]); + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableEnum8 response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt16s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableEnum8 read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59510,75 +82545,74 @@ class ReadTestClusterRangeRestrictedInt16s : public ReadAttribute { } }; -class WriteTestClusterRangeRestrictedInt16s : public WriteAttribute { +class WriteTestClusterNullableEnum8 : public WriteAttribute { public: - WriteTestClusterRangeRestrictedInt16s() - : WriteAttribute("range-restricted-int16s") + WriteTestClusterNullableEnum8() + : WriteAttribute("nullable-enum8") { - AddArgument("attr-name", "range-restricted-int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "nullable-enum8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterRangeRestrictedInt16s() {} + ~WriteTestClusterNullableEnum8() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeRangeRestrictedInt16sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster RangeRestrictedInt16s write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableEnum8WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableEnum8 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + uint8_t mValue; }; -class SubscribeAttributeTestClusterRangeRestrictedInt16s : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableEnum8 : public SubscribeAttribute { public: - SubscribeAttributeTestClusterRangeRestrictedInt16s() - : SubscribeAttribute("range-restricted-int16s") + SubscribeAttributeTestClusterNullableEnum8() + : SubscribeAttribute("nullable-enum8") { } - ~SubscribeAttributeTestClusterRangeRestrictedInt16s() {} + ~SubscribeAttributeTestClusterNullableEnum8() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeRangeRestrictedInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.RangeRestrictedInt16s response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableEnum8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableEnum8 response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59590,30 +82624,30 @@ class SubscribeAttributeTestClusterRangeRestrictedInt16s : public SubscribeAttri }; /* - * Attribute ListLongOctetString + * Attribute NullableEnum16 */ -class ReadTestClusterListLongOctetString : public ReadAttribute { +class ReadTestClusterNullableEnum16 : public ReadAttribute { public: - ReadTestClusterListLongOctetString() - : ReadAttribute("list-long-octet-string") + ReadTestClusterNullableEnum16() + : ReadAttribute("nullable-enum16") { } - ~ReadTestClusterListLongOctetString() {} + ~ReadTestClusterNullableEnum16() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000002A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeListLongOctetStringWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListLongOctetString response %@", [value description]); + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableEnum16 response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ListLongOctetString read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableEnum16 read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59621,82 +82655,70 @@ class ReadTestClusterListLongOctetString : public ReadAttribute { } }; -class WriteTestClusterListLongOctetString : public WriteAttribute { +class WriteTestClusterNullableEnum16 : public WriteAttribute { public: - WriteTestClusterListLongOctetString() - : WriteAttribute("list-long-octet-string") - , mComplex(&mValue) + WriteTestClusterNullableEnum16() + : WriteAttribute("nullable-enum16") { - AddArgument("attr-name", "list-long-octet-string"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "nullable-enum16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterListLongOctetString() {} + ~WriteTestClusterNullableEnum16() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000002A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeListLongOctetStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster ListLongOctetString write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableEnum16WithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableEnum16 write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; + uint16_t mValue; }; -class SubscribeAttributeTestClusterListLongOctetString : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableEnum16 : public SubscribeAttribute { public: - SubscribeAttributeTestClusterListLongOctetString() - : SubscribeAttribute("list-long-octet-string") + SubscribeAttributeTestClusterNullableEnum16() + : SubscribeAttribute("nullable-enum16") { } - ~SubscribeAttributeTestClusterListLongOctetString() {} + ~SubscribeAttributeTestClusterNullableEnum16() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000002A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeListLongOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeNullableEnum16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListLongOctetString response %@", [value description]); + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableEnum16 response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -59712,170 +82734,106 @@ class SubscribeAttributeTestClusterListLongOctetString : public SubscribeAttribu }; /* - * Attribute ListFabricScoped + * Attribute NullableFloatSingle */ -class ReadTestClusterListFabricScoped : public ReadAttribute { +class ReadTestClusterNullableFloatSingle : public ReadAttribute { public: - ReadTestClusterListFabricScoped() - : ReadAttribute("list-fabric-scoped") + ReadTestClusterNullableFloatSingle() + : ReadAttribute("nullable-float-single") { } - ~ReadTestClusterListFabricScoped() {} + ~ReadTestClusterNullableFloatSingle() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000002B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - CHIPReadParams * params = [[CHIPReadParams alloc] init]; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster readAttributeListFabricScopedWithParams:params - completionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListFabricScoped response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableFloatSingle response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster ListFabricScoped read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableFloatSingle read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterListFabricScoped : public WriteAttribute { +class WriteTestClusterNullableFloatSingle : public WriteAttribute { public: - WriteTestClusterListFabricScoped() - : WriteAttribute("list-fabric-scoped") - , mComplex(&mValue) + WriteTestClusterNullableFloatSingle() + : WriteAttribute("nullable-float-single") { - AddArgument("attr-name", "list-fabric-scoped"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "nullable-float-single"); + AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterListFabricScoped() {} + ~WriteTestClusterNullableFloatSingle() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000002B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mValue) { - CHIPTestClusterClusterTestFabricScoped * newElement_0; - newElement_0 = [CHIPTestClusterClusterTestFabricScoped new]; - newElement_0.fabricSensitiveInt8u = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveInt8u]; - if (entry_0.optionalFabricSensitiveInt8u.HasValue()) { - newElement_0.optionalFabricSensitiveInt8u = - [NSNumber numberWithUnsignedChar:entry_0.optionalFabricSensitiveInt8u.Value()]; - } else { - newElement_0.optionalFabricSensitiveInt8u = nil; - } - if (entry_0.nullableFabricSensitiveInt8u.IsNull()) { - newElement_0.nullableFabricSensitiveInt8u = nil; - } else { - newElement_0.nullableFabricSensitiveInt8u = - [NSNumber numberWithUnsignedChar:entry_0.nullableFabricSensitiveInt8u.Value()]; - } - if (entry_0.nullableOptionalFabricSensitiveInt8u.HasValue()) { - if (entry_0.nullableOptionalFabricSensitiveInt8u.Value().IsNull()) { - newElement_0.nullableOptionalFabricSensitiveInt8u = nil; - } else { - newElement_0.nullableOptionalFabricSensitiveInt8u = - [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalFabricSensitiveInt8u.Value().Value()]; - } - } else { - newElement_0.nullableOptionalFabricSensitiveInt8u = nil; - } - newElement_0.fabricSensitiveCharString = [[NSString alloc] initWithBytes:entry_0.fabricSensitiveCharString.data() - length:entry_0.fabricSensitiveCharString.size() - encoding:NSUTF8StringEncoding]; - newElement_0.fabricSensitiveStruct = [CHIPTestClusterClusterSimpleStruct new]; - newElement_0.fabricSensitiveStruct.a = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.a]; - newElement_0.fabricSensitiveStruct.b = [NSNumber numberWithBool:entry_0.fabricSensitiveStruct.b]; - newElement_0.fabricSensitiveStruct.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.fabricSensitiveStruct.c)]; - newElement_0.fabricSensitiveStruct.d = [NSData dataWithBytes:entry_0.fabricSensitiveStruct.d.data() - length:entry_0.fabricSensitiveStruct.d.size()]; - newElement_0.fabricSensitiveStruct.e = [[NSString alloc] initWithBytes:entry_0.fabricSensitiveStruct.e.data() - length:entry_0.fabricSensitiveStruct.e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.fabricSensitiveStruct.f = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.f.Raw()]; - newElement_0.fabricSensitiveStruct.g = [NSNumber numberWithFloat:entry_0.fabricSensitiveStruct.g]; - newElement_0.fabricSensitiveStruct.h = [NSNumber numberWithDouble:entry_0.fabricSensitiveStruct.h]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - for (auto & entry_2 : entry_0.fabricSensitiveInt8uList) { - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; - [array_2 addObject:newElement_2]; - } - newElement_0.fabricSensitiveInt8uList = array_2; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - value = array_0; - } + NSNumber * _Nullable value = [NSNumber numberWithFloat:mValue]; - [cluster writeAttributeListFabricScopedWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster ListFabricScoped write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableFloatSingleWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableFloatSingle write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::List mValue; - TypedComplexArgument> - mComplex; + float mValue; }; -class SubscribeAttributeTestClusterListFabricScoped : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableFloatSingle : public SubscribeAttribute { public: - SubscribeAttributeTestClusterListFabricScoped() - : SubscribeAttribute("list-fabric-scoped") + SubscribeAttributeTestClusterNullableFloatSingle() + : SubscribeAttribute("nullable-float-single") { } - ~SubscribeAttributeTestClusterListFabricScoped() {} + ~SubscribeAttributeTestClusterNullableFloatSingle() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000002B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeListFabricScopedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ListFabricScoped response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNullableFloatSingleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableFloatSingle response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59887,30 +82845,30 @@ class SubscribeAttributeTestClusterListFabricScoped : public SubscribeAttribute }; /* - * Attribute TimedWriteBoolean + * Attribute NullableFloatDouble */ -class ReadTestClusterTimedWriteBoolean : public ReadAttribute { +class ReadTestClusterNullableFloatDouble : public ReadAttribute { public: - ReadTestClusterTimedWriteBoolean() - : ReadAttribute("timed-write-boolean") + ReadTestClusterNullableFloatDouble() + : ReadAttribute("nullable-float-double") { } - ~ReadTestClusterTimedWriteBoolean() {} + ~ReadTestClusterNullableFloatDouble() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000030) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeTimedWriteBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.TimedWriteBoolean response %@", [value description]); + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableFloatDouble response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster TimedWriteBoolean read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableFloatDouble read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -59918,74 +82876,75 @@ class ReadTestClusterTimedWriteBoolean : public ReadAttribute { } }; -class WriteTestClusterTimedWriteBoolean : public WriteAttribute { +class WriteTestClusterNullableFloatDouble : public WriteAttribute { public: - WriteTestClusterTimedWriteBoolean() - : WriteAttribute("timed-write-boolean") + WriteTestClusterNullableFloatDouble() + : WriteAttribute("nullable-float-double") { - AddArgument("attr-name", "timed-write-boolean"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "nullable-float-double"); + AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterTimedWriteBoolean() {} + ~WriteTestClusterNullableFloatDouble() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000030) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithDouble:mValue]; - [cluster writeAttributeTimedWriteBooleanWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster TimedWriteBoolean write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableFloatDoubleWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableFloatDouble write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + double mValue; }; -class SubscribeAttributeTestClusterTimedWriteBoolean : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableFloatDouble : public SubscribeAttribute { public: - SubscribeAttributeTestClusterTimedWriteBoolean() - : SubscribeAttribute("timed-write-boolean") + SubscribeAttributeTestClusterNullableFloatDouble() + : SubscribeAttribute("nullable-float-double") { } - ~SubscribeAttributeTestClusterTimedWriteBoolean() {} + ~SubscribeAttributeTestClusterNullableFloatDouble() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000030) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeTimedWriteBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.TimedWriteBoolean response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNullableFloatDoubleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableFloatDouble response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -59997,30 +82956,30 @@ class SubscribeAttributeTestClusterTimedWriteBoolean : public SubscribeAttribute }; /* - * Attribute GeneralErrorBoolean + * Attribute NullableOctetString */ -class ReadTestClusterGeneralErrorBoolean : public ReadAttribute { +class ReadTestClusterNullableOctetString : public ReadAttribute { public: - ReadTestClusterGeneralErrorBoolean() - : ReadAttribute("general-error-boolean") + ReadTestClusterNullableOctetString() + : ReadAttribute("nullable-octet-string") { } - ~ReadTestClusterGeneralErrorBoolean() {} + ~ReadTestClusterNullableOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000031) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneralErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.GeneralErrorBoolean response %@", [value description]); + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableOctetString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster GeneralErrorBoolean read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableOctetString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60028,35 +82987,35 @@ class ReadTestClusterGeneralErrorBoolean : public ReadAttribute { } }; -class WriteTestClusterGeneralErrorBoolean : public WriteAttribute { +class WriteTestClusterNullableOctetString : public WriteAttribute { public: - WriteTestClusterGeneralErrorBoolean() - : WriteAttribute("general-error-boolean") + WriteTestClusterNullableOctetString() + : WriteAttribute("nullable-octet-string") { - AddArgument("attr-name", "general-error-boolean"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "nullable-octet-string"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterGeneralErrorBoolean() {} + ~WriteTestClusterNullableOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000031) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSData * _Nullable value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - [cluster writeAttributeGeneralErrorBooleanWithValue:value + [cluster writeAttributeNullableOctetStringWithValue:value params:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster GeneralErrorBoolean write Error: %s", + ChipLogError(chipTool, "TestCluster NullableOctetString write Error: %s", chip::ErrorStr(chipError)); } SetCommandExitStatus(chipError); @@ -60065,21 +83024,21 @@ class WriteTestClusterGeneralErrorBoolean : public WriteAttribute { } private: - bool mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeTestClusterGeneralErrorBoolean : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableOctetString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterGeneralErrorBoolean() - : SubscribeAttribute("general-error-boolean") + SubscribeAttributeTestClusterNullableOctetString() + : SubscribeAttribute("nullable-octet-string") { } - ~SubscribeAttributeTestClusterGeneralErrorBoolean() {} + ~SubscribeAttributeTestClusterNullableOctetString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000031) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -60087,12 +83046,12 @@ class SubscribeAttributeTestClusterGeneralErrorBoolean : public SubscribeAttribu = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeGeneralErrorBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + subscribeAttributeNullableOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.GeneralErrorBoolean response %@", [value description]); + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableOctetString response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -60108,30 +83067,30 @@ class SubscribeAttributeTestClusterGeneralErrorBoolean : public SubscribeAttribu }; /* - * Attribute ClusterErrorBoolean + * Attribute NullableCharString */ -class ReadTestClusterClusterErrorBoolean : public ReadAttribute { +class ReadTestClusterNullableCharString : public ReadAttribute { public: - ReadTestClusterClusterErrorBoolean() - : ReadAttribute("cluster-error-boolean") + ReadTestClusterNullableCharString() + : ReadAttribute("nullable-char-string") { } - ~ReadTestClusterClusterErrorBoolean() {} + ~ReadTestClusterNullableCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000032) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000401E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterErrorBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ClusterErrorBoolean response %@", [value description]); + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableCharString response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ClusterErrorBoolean read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableCharString read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60139,58 +83098,60 @@ class ReadTestClusterClusterErrorBoolean : public ReadAttribute { } }; -class WriteTestClusterClusterErrorBoolean : public WriteAttribute { +class WriteTestClusterNullableCharString : public WriteAttribute { public: - WriteTestClusterClusterErrorBoolean() - : WriteAttribute("cluster-error-boolean") + WriteTestClusterNullableCharString() + : WriteAttribute("nullable-char-string") { - AddArgument("attr-name", "cluster-error-boolean"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "nullable-char-string"); + AddArgument("attr-value", &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterClusterErrorBoolean() {} + ~WriteTestClusterNullableCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000032) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000401E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSString * _Nullable value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; - [cluster writeAttributeClusterErrorBooleanWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster ClusterErrorBoolean write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableCharStringWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableCharString write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + chip::ByteSpan mValue; }; -class SubscribeAttributeTestClusterClusterErrorBoolean : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableCharString : public SubscribeAttribute { public: - SubscribeAttributeTestClusterClusterErrorBoolean() - : SubscribeAttribute("cluster-error-boolean") + SubscribeAttributeTestClusterNullableCharString() + : SubscribeAttribute("nullable-char-string") { } - ~SubscribeAttributeTestClusterClusterErrorBoolean() {} + ~SubscribeAttributeTestClusterNullableCharString() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000032) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000401E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -60198,16 +83159,16 @@ class SubscribeAttributeTestClusterClusterErrorBoolean : public SubscribeAttribu = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeClusterErrorBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ClusterErrorBoolean response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeNullableCharStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableCharString response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60219,30 +83180,30 @@ class SubscribeAttributeTestClusterClusterErrorBoolean : public SubscribeAttribu }; /* - * Attribute Unsupported + * Attribute NullableEnumAttr */ -class ReadTestClusterUnsupported : public ReadAttribute { +class ReadTestClusterNullableEnumAttr : public ReadAttribute { public: - ReadTestClusterUnsupported() - : ReadAttribute("unsupported") + ReadTestClusterNullableEnumAttr() + : ReadAttribute("nullable-enum-attr") { } - ~ReadTestClusterUnsupported() {} + ~ReadTestClusterNullableEnumAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x000000FF) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeUnsupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Unsupported response %@", [value description]); + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableEnumAttr response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster Unsupported read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableEnumAttr read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60250,74 +83211,74 @@ class ReadTestClusterUnsupported : public ReadAttribute { } }; -class WriteTestClusterUnsupported : public WriteAttribute { +class WriteTestClusterNullableEnumAttr : public WriteAttribute { public: - WriteTestClusterUnsupported() - : WriteAttribute("unsupported") + WriteTestClusterNullableEnumAttr() + : WriteAttribute("nullable-enum-attr") { - AddArgument("attr-name", "unsupported"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "nullable-enum-attr"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterUnsupported() {} + ~WriteTestClusterNullableEnumAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x000000FF) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeUnsupportedWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster Unsupported write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableEnumAttrWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "TestCluster NullableEnumAttr write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + uint8_t mValue; }; -class SubscribeAttributeTestClusterUnsupported : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableEnumAttr : public SubscribeAttribute { public: - SubscribeAttributeTestClusterUnsupported() - : SubscribeAttribute("unsupported") + SubscribeAttributeTestClusterNullableEnumAttr() + : SubscribeAttribute("nullable-enum-attr") { } - ~SubscribeAttributeTestClusterUnsupported() {} + ~SubscribeAttributeTestClusterNullableEnumAttr() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x000000FF) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeUnsupportedWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.Unsupported response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableEnumAttrWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableEnumAttr response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60329,30 +83290,31 @@ class SubscribeAttributeTestClusterUnsupported : public SubscribeAttribute { }; /* - * Attribute NullableBoolean + * Attribute NullableStruct */ -class ReadTestClusterNullableBoolean : public ReadAttribute { +class ReadTestClusterNullableStruct : public ReadAttribute { public: - ReadTestClusterNullableBoolean() - : ReadAttribute("nullable-boolean") + ReadTestClusterNullableStruct() + : ReadAttribute("nullable-struct") { } - ~ReadTestClusterNullableBoolean() {} + ~ReadTestClusterNullableStruct() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableBooleanWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBoolean response %@", [value description]); + [cluster readAttributeNullableStructWithCompletionHandler:^( + CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableStruct response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBoolean read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableStruct read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60360,74 +83322,92 @@ class ReadTestClusterNullableBoolean : public ReadAttribute { } }; -class WriteTestClusterNullableBoolean : public WriteAttribute { +class WriteTestClusterNullableStruct : public WriteAttribute { public: - WriteTestClusterNullableBoolean() - : WriteAttribute("nullable-boolean") + WriteTestClusterNullableStruct() + : WriteAttribute("nullable-struct") + , mComplex(&mValue) { - AddArgument("attr-name", "nullable-boolean"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "nullable-struct"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableBoolean() {} + ~WriteTestClusterNullableStruct() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithBool:mValue]; + CHIPTestClusterClusterSimpleStruct * _Nullable value; + if (mValue.IsNull()) { + value = nil; + } else { + value = [CHIPTestClusterClusterSimpleStruct new]; + value.a = [NSNumber numberWithUnsignedChar:mValue.Value().a]; + value.b = [NSNumber numberWithBool:mValue.Value().b]; + value.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().c)]; + value.d = [NSData dataWithBytes:mValue.Value().d.data() length:mValue.Value().d.size()]; + value.e = [[NSString alloc] initWithBytes:mValue.Value().e.data() + length:mValue.Value().e.size() + encoding:NSUTF8StringEncoding]; + value.f = [NSNumber numberWithUnsignedChar:mValue.Value().f.Raw()]; + value.g = [NSNumber numberWithFloat:mValue.Value().g]; + value.h = [NSNumber numberWithDouble:mValue.Value().h]; + } - [cluster writeAttributeNullableBooleanWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBoolean write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableStructWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "TestCluster NullableStruct write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - bool mValue; + chip::app::DataModel::Nullable mValue; + TypedComplexArgument> mComplex; }; -class SubscribeAttributeTestClusterNullableBoolean : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableStruct : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableBoolean() - : SubscribeAttribute("nullable-boolean") + SubscribeAttributeTestClusterNullableStruct() + : SubscribeAttribute("nullable-struct") { } - ~SubscribeAttributeTestClusterNullableBoolean() {} + ~SubscribeAttributeTestClusterNullableStruct() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableBooleanWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBoolean response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeNullableStructWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error) { + NSLog(@"TestCluster.NullableStruct response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60439,30 +83419,31 @@ class SubscribeAttributeTestClusterNullableBoolean : public SubscribeAttribute { }; /* - * Attribute NullableBitmap8 + * Attribute NullableRangeRestrictedInt8u */ -class ReadTestClusterNullableBitmap8 : public ReadAttribute { +class ReadTestClusterNullableRangeRestrictedInt8u : public ReadAttribute { public: - ReadTestClusterNullableBitmap8() - : ReadAttribute("nullable-bitmap8") + ReadTestClusterNullableRangeRestrictedInt8u() + : ReadAttribute("nullable-range-restricted-int8u") { } - ~ReadTestClusterNullableBitmap8() {} + ~ReadTestClusterNullableRangeRestrictedInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableBitmap8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap8 response %@", [value description]); + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt8u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap8 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt8u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60470,21 +83451,21 @@ class ReadTestClusterNullableBitmap8 : public ReadAttribute { } }; -class WriteTestClusterNullableBitmap8 : public WriteAttribute { +class WriteTestClusterNullableRangeRestrictedInt8u : public WriteAttribute { public: - WriteTestClusterNullableBitmap8() - : WriteAttribute("nullable-bitmap8") + WriteTestClusterNullableRangeRestrictedInt8u() + : WriteAttribute("nullable-range-restricted-int8u") { - AddArgument("attr-name", "nullable-bitmap8"); + AddArgument("attr-name", "nullable-range-restricted-int8u"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableBitmap8() {} + ~WriteTestClusterNullableRangeRestrictedInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; @@ -60493,16 +83474,17 @@ class WriteTestClusterNullableBitmap8 : public WriteAttribute { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeNullableBitmap8WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap8 write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "TestCluster NullableRangeRestrictedInt8u write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -60510,34 +83492,36 @@ class WriteTestClusterNullableBitmap8 : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeTestClusterNullableBitmap8 : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableRangeRestrictedInt8u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableBitmap8() - : SubscribeAttribute("nullable-bitmap8") + SubscribeAttributeTestClusterNullableRangeRestrictedInt8u() + : SubscribeAttribute("nullable-range-restricted-int8u") { } - ~SubscribeAttributeTestClusterNullableBitmap8() {} + ~SubscribeAttributeTestClusterNullableRangeRestrictedInt8u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004026) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableBitmap8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap8 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNullableRangeRestrictedInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt8u response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60549,30 +83533,31 @@ class SubscribeAttributeTestClusterNullableBitmap8 : public SubscribeAttribute { }; /* - * Attribute NullableBitmap16 + * Attribute NullableRangeRestrictedInt8s */ -class ReadTestClusterNullableBitmap16 : public ReadAttribute { +class ReadTestClusterNullableRangeRestrictedInt8s : public ReadAttribute { public: - ReadTestClusterNullableBitmap16() - : ReadAttribute("nullable-bitmap16") + ReadTestClusterNullableRangeRestrictedInt8s() + : ReadAttribute("nullable-range-restricted-int8s") { } - ~ReadTestClusterNullableBitmap16() {} + ~ReadTestClusterNullableRangeRestrictedInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableBitmap16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap16 response %@", [value description]); + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt8s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap16 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt8s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60580,74 +83565,77 @@ class ReadTestClusterNullableBitmap16 : public ReadAttribute { } }; -class WriteTestClusterNullableBitmap16 : public WriteAttribute { +class WriteTestClusterNullableRangeRestrictedInt8s : public WriteAttribute { public: - WriteTestClusterNullableBitmap16() - : WriteAttribute("nullable-bitmap16") + WriteTestClusterNullableRangeRestrictedInt8s() + : WriteAttribute("nullable-range-restricted-int8s") { - AddArgument("attr-name", "nullable-bitmap16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); + AddArgument("attr-name", "nullable-range-restricted-int8s"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableBitmap16() {} + ~WriteTestClusterNullableRangeRestrictedInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; - [cluster writeAttributeNullableBitmap16WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap16 write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "TestCluster NullableRangeRestrictedInt8s write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint16_t mValue; + int8_t mValue; }; -class SubscribeAttributeTestClusterNullableBitmap16 : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableRangeRestrictedInt8s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableBitmap16() - : SubscribeAttribute("nullable-bitmap16") + SubscribeAttributeTestClusterNullableRangeRestrictedInt8s() + : SubscribeAttribute("nullable-range-restricted-int8s") { } - ~SubscribeAttributeTestClusterNullableBitmap16() {} + ~SubscribeAttributeTestClusterNullableRangeRestrictedInt8s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004027) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableBitmap16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap16 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNullableRangeRestrictedInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt8s response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60659,30 +83647,31 @@ class SubscribeAttributeTestClusterNullableBitmap16 : public SubscribeAttribute }; /* - * Attribute NullableBitmap32 + * Attribute NullableRangeRestrictedInt16u */ -class ReadTestClusterNullableBitmap32 : public ReadAttribute { +class ReadTestClusterNullableRangeRestrictedInt16u : public ReadAttribute { public: - ReadTestClusterNullableBitmap32() - : ReadAttribute("nullable-bitmap32") + ReadTestClusterNullableRangeRestrictedInt16u() + : ReadAttribute("nullable-range-restricted-int16u") { } - ~ReadTestClusterNullableBitmap32() {} + ~ReadTestClusterNullableRangeRestrictedInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableBitmap32WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap32 response %@", [value description]); + [cluster readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt16u response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap32 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt16u read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60690,74 +83679,78 @@ class ReadTestClusterNullableBitmap32 : public ReadAttribute { } }; -class WriteTestClusterNullableBitmap32 : public WriteAttribute { +class WriteTestClusterNullableRangeRestrictedInt16u : public WriteAttribute { public: - WriteTestClusterNullableBitmap32() - : WriteAttribute("nullable-bitmap32") + WriteTestClusterNullableRangeRestrictedInt16u() + : WriteAttribute("nullable-range-restricted-int16u") { - AddArgument("attr-name", "nullable-bitmap32"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); + AddArgument("attr-name", "nullable-range-restricted-int16u"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableBitmap32() {} + ~WriteTestClusterNullableRangeRestrictedInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeNullableBitmap32WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap32 write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "TestCluster NullableRangeRestrictedInt16u write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint32_t mValue; + uint16_t mValue; }; -class SubscribeAttributeTestClusterNullableBitmap32 : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableRangeRestrictedInt16u : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableBitmap32() - : SubscribeAttribute("nullable-bitmap32") + SubscribeAttributeTestClusterNullableRangeRestrictedInt16u() + : SubscribeAttribute("nullable-range-restricted-int16u") { } - ~SubscribeAttributeTestClusterNullableBitmap32() {} + ~SubscribeAttributeTestClusterNullableRangeRestrictedInt16u() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004028) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableBitmap32WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap32 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNullableRangeRestrictedInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt16u response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60769,30 +83762,31 @@ class SubscribeAttributeTestClusterNullableBitmap32 : public SubscribeAttribute }; /* - * Attribute NullableBitmap64 + * Attribute NullableRangeRestrictedInt16s */ -class ReadTestClusterNullableBitmap64 : public ReadAttribute { +class ReadTestClusterNullableRangeRestrictedInt16s : public ReadAttribute { public: - ReadTestClusterNullableBitmap64() - : ReadAttribute("nullable-bitmap64") + ReadTestClusterNullableRangeRestrictedInt16s() + : ReadAttribute("nullable-range-restricted-int16s") { } - ~ReadTestClusterNullableBitmap64() {} + ~ReadTestClusterNullableRangeRestrictedInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableBitmap64WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap64 response %@", [value description]); + [cluster readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt16s response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap64 read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt16s read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60800,74 +83794,78 @@ class ReadTestClusterNullableBitmap64 : public ReadAttribute { } }; -class WriteTestClusterNullableBitmap64 : public WriteAttribute { +class WriteTestClusterNullableRangeRestrictedInt16s : public WriteAttribute { public: - WriteTestClusterNullableBitmap64() - : WriteAttribute("nullable-bitmap64") + WriteTestClusterNullableRangeRestrictedInt16s() + : WriteAttribute("nullable-range-restricted-int16s") { - AddArgument("attr-name", "nullable-bitmap64"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); + AddArgument("attr-name", "nullable-range-restricted-int16s"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableBitmap64() {} + ~WriteTestClusterNullableRangeRestrictedInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableBitmap64WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableBitmap64 write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "TestCluster NullableRangeRestrictedInt16s write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint64_t mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableBitmap64 : public SubscribeAttribute { +class SubscribeAttributeTestClusterNullableRangeRestrictedInt16s : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableBitmap64() - : SubscribeAttribute("nullable-bitmap64") + SubscribeAttributeTestClusterNullableRangeRestrictedInt16s() + : SubscribeAttribute("nullable-range-restricted-int16s") { } - ~SubscribeAttributeTestClusterNullableBitmap64() {} + ~SubscribeAttributeTestClusterNullableRangeRestrictedInt16s() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableBitmap64WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableBitmap64 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNullableRangeRestrictedInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.NullableRangeRestrictedInt16s response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60879,30 +83877,30 @@ class SubscribeAttributeTestClusterNullableBitmap64 : public SubscribeAttribute }; /* - * Attribute NullableInt8u + * Attribute GeneratedCommandList */ -class ReadTestClusterNullableInt8u : public ReadAttribute { +class ReadTestClusterGeneratedCommandList : public ReadAttribute { public: - ReadTestClusterNullableInt8u() - : ReadAttribute("nullable-int8u") + ReadTestClusterGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadTestClusterNullableInt8u() {} + ~ReadTestClusterGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt8u response %@", [value description]); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.GeneratedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt8u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster GeneratedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -60910,74 +83908,35 @@ class ReadTestClusterNullableInt8u : public ReadAttribute { } }; -class WriteTestClusterNullableInt8u : public WriteAttribute { -public: - WriteTestClusterNullableInt8u() - : WriteAttribute("nullable-int8u") - { - AddArgument("attr-name", "nullable-int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt8u() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004005) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeNullableInt8uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt8u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt8u : public SubscribeAttribute { +class SubscribeAttributeTestClusterGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt8u() - : SubscribeAttribute("nullable-int8u") + SubscribeAttributeTestClusterGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeTestClusterNullableInt8u() {} + ~SubscribeAttributeTestClusterGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt8u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -60989,30 +83948,30 @@ class SubscribeAttributeTestClusterNullableInt8u : public SubscribeAttribute { }; /* - * Attribute NullableInt16u + * Attribute AcceptedCommandList */ -class ReadTestClusterNullableInt16u : public ReadAttribute { +class ReadTestClusterAcceptedCommandList : public ReadAttribute { public: - ReadTestClusterNullableInt16u() - : ReadAttribute("nullable-int16u") + ReadTestClusterAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadTestClusterNullableInt16u() {} + ~ReadTestClusterAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt16u response %@", [value description]); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.AcceptedCommandList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt16u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster AcceptedCommandList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61020,70 +83979,31 @@ class ReadTestClusterNullableInt16u : public ReadAttribute { } }; -class WriteTestClusterNullableInt16u : public WriteAttribute { -public: - WriteTestClusterNullableInt16u() - : WriteAttribute("nullable-int16u") - { - AddArgument("attr-name", "nullable-int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt16u() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004006) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - - [cluster writeAttributeNullableInt16uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt16u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint16_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt16u : public SubscribeAttribute { +class SubscribeAttributeTestClusterAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt16u() - : SubscribeAttribute("nullable-int16u") + SubscribeAttributeTestClusterAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeTestClusterNullableInt16u() {} + ~SubscribeAttributeTestClusterAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt16u response %@", [value description]); + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.AcceptedCommandList response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); } @@ -61099,30 +84019,30 @@ class SubscribeAttributeTestClusterNullableInt16u : public SubscribeAttribute { }; /* - * Attribute NullableInt24u + * Attribute AttributeList */ -class ReadTestClusterNullableInt24u : public ReadAttribute { +class ReadTestClusterAttributeList : public ReadAttribute { public: - ReadTestClusterNullableInt24u() - : ReadAttribute("nullable-int24u") + ReadTestClusterAttributeList() + : ReadAttribute("attribute-list") { } - ~ReadTestClusterNullableInt24u() {} + ~ReadTestClusterAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt24uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt24u response %@", [value description]); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.AttributeList response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt24u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster AttributeList read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61130,74 +84050,34 @@ class ReadTestClusterNullableInt24u : public ReadAttribute { } }; -class WriteTestClusterNullableInt24u : public WriteAttribute { -public: - WriteTestClusterNullableInt24u() - : WriteAttribute("nullable-int24u") - { - AddArgument("attr-name", "nullable-int24u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt24u() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004007) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; - - [cluster writeAttributeNullableInt24uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt24u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint32_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt24u : public SubscribeAttribute { +class SubscribeAttributeTestClusterAttributeList : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt24u() - : SubscribeAttribute("nullable-int24u") + SubscribeAttributeTestClusterAttributeList() + : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeTestClusterNullableInt24u() {} + ~SubscribeAttributeTestClusterAttributeList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004007) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt24uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt24u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -61209,30 +84089,30 @@ class SubscribeAttributeTestClusterNullableInt24u : public SubscribeAttribute { }; /* - * Attribute NullableInt32u + * Attribute FeatureMap */ -class ReadTestClusterNullableInt32u : public ReadAttribute { +class ReadTestClusterFeatureMap : public ReadAttribute { public: - ReadTestClusterNullableInt32u() - : ReadAttribute("nullable-int32u") + ReadTestClusterFeatureMap() + : ReadAttribute("feature-map") { } - ~ReadTestClusterNullableInt32u() {} + ~ReadTestClusterFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt32u response %@", [value description]); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.FeatureMap response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt32u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster FeatureMap read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61240,74 +84120,34 @@ class ReadTestClusterNullableInt32u : public ReadAttribute { } }; -class WriteTestClusterNullableInt32u : public WriteAttribute { -public: - WriteTestClusterNullableInt32u() - : WriteAttribute("nullable-int32u") - { - AddArgument("attr-name", "nullable-int32u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt32u() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004008) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; - - [cluster writeAttributeNullableInt32uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt32u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint32_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt32u : public SubscribeAttribute { +class SubscribeAttributeTestClusterFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt32u() - : SubscribeAttribute("nullable-int32u") + SubscribeAttributeTestClusterFeatureMap() + : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeTestClusterNullableInt32u() {} + ~SubscribeAttributeTestClusterFeatureMap() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt32uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt32u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -61319,30 +84159,30 @@ class SubscribeAttributeTestClusterNullableInt32u : public SubscribeAttribute { }; /* - * Attribute NullableInt40u + * Attribute ClusterRevision */ -class ReadTestClusterNullableInt40u : public ReadAttribute { +class ReadTestClusterClusterRevision : public ReadAttribute { public: - ReadTestClusterNullableInt40u() - : ReadAttribute("nullable-int40u") + ReadTestClusterClusterRevision() + : ReadAttribute("cluster-revision") { } - ~ReadTestClusterNullableInt40u() {} + ~ReadTestClusterClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt40uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt40u response %@", [value description]); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ClusterRevision response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt40u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "TestCluster ClusterRevision read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61350,74 +84190,34 @@ class ReadTestClusterNullableInt40u : public ReadAttribute { } }; -class WriteTestClusterNullableInt40u : public WriteAttribute { -public: - WriteTestClusterNullableInt40u() - : WriteAttribute("nullable-int40u") - { - AddArgument("attr-name", "nullable-int40u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt40u() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004009) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - - [cluster writeAttributeNullableInt40uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt40u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint64_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt40u : public SubscribeAttribute { +class SubscribeAttributeTestClusterClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt40u() - : SubscribeAttribute("nullable-int40u") + SubscribeAttributeTestClusterClusterRevision() + : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeTestClusterNullableInt40u() {} + ~SubscribeAttributeTestClusterClusterRevision() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004009) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt40uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt40u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TestCluster.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -61428,251 +84228,354 @@ class SubscribeAttributeTestClusterNullableInt40u : public SubscribeAttribute { } }; +/*----------------------------------------------------------------------------*\ +| Cluster Thermostat | 0x0201 | +|------------------------------------------------------------------------------| +| Commands: | | +| * SetpointRaiseLower | 0x00 | +| * SetWeeklySchedule | 0x01 | +| * GetWeeklySchedule | 0x02 | +| * ClearWeeklySchedule | 0x03 | +| * GetRelayStatusLog | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * LocalTemperature | 0x0000 | +| * OutdoorTemperature | 0x0001 | +| * Occupancy | 0x0002 | +| * AbsMinHeatSetpointLimit | 0x0003 | +| * AbsMaxHeatSetpointLimit | 0x0004 | +| * AbsMinCoolSetpointLimit | 0x0005 | +| * AbsMaxCoolSetpointLimit | 0x0006 | +| * PiCoolingDemand | 0x0007 | +| * PiHeatingDemand | 0x0008 | +| * HvacSystemTypeConfiguration | 0x0009 | +| * LocalTemperatureCalibration | 0x0010 | +| * OccupiedCoolingSetpoint | 0x0011 | +| * OccupiedHeatingSetpoint | 0x0012 | +| * UnoccupiedCoolingSetpoint | 0x0013 | +| * UnoccupiedHeatingSetpoint | 0x0014 | +| * MinHeatSetpointLimit | 0x0015 | +| * MaxHeatSetpointLimit | 0x0016 | +| * MinCoolSetpointLimit | 0x0017 | +| * MaxCoolSetpointLimit | 0x0018 | +| * MinSetpointDeadBand | 0x0019 | +| * RemoteSensing | 0x001A | +| * ControlSequenceOfOperation | 0x001B | +| * SystemMode | 0x001C | +| * AlarmMask | 0x001D | +| * ThermostatRunningMode | 0x001E | +| * StartOfWeek | 0x0020 | +| * NumberOfWeeklyTransitions | 0x0021 | +| * NumberOfDailyTransitions | 0x0022 | +| * TemperatureSetpointHold | 0x0023 | +| * TemperatureSetpointHoldDuration | 0x0024 | +| * ThermostatProgrammingOperationMode | 0x0025 | +| * ThermostatRunningState | 0x0029 | +| * SetpointChangeSource | 0x0030 | +| * SetpointChangeAmount | 0x0031 | +| * SetpointChangeSourceTimestamp | 0x0032 | +| * AcType | 0x0040 | +| * AcCapacity | 0x0041 | +| * AcRefrigerantType | 0x0042 | +| * AcCompressorType | 0x0043 | +| * AcErrorCode | 0x0044 | +| * AcLouverPosition | 0x0045 | +| * AcCoilTemperature | 0x0046 | +| * AcCapacityFormat | 0x0047 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + /* - * Attribute NullableInt48u + * Command SetpointRaiseLower */ -class ReadTestClusterNullableInt48u : public ReadAttribute { +class ThermostatSetpointRaiseLower : public ClusterCommand { public: - ReadTestClusterNullableInt48u() - : ReadAttribute("nullable-int48u") + ThermostatSetpointRaiseLower() + : ClusterCommand("setpoint-raise-lower") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("Mode", 0, UINT8_MAX, &mMode); + AddArgument("Amount", INT8_MIN, INT8_MAX, &mAmount); + ClusterCommand::AddArguments(); } - ~ReadTestClusterNullableInt48u() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt48uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt48u response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt48u read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPThermostatClusterSetpointRaiseLowerParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.mode = [NSNumber numberWithUnsignedChar:mMode]; + params.amount = [NSNumber numberWithChar:mAmount]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setpointRaiseLowerWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } + +private: + chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type mRequest; + uint8_t mMode; + int8_t mAmount; }; -class WriteTestClusterNullableInt48u : public WriteAttribute { +/* + * Command SetWeeklySchedule + */ +class ThermostatSetWeeklySchedule : public ClusterCommand { public: - WriteTestClusterNullableInt48u() - : WriteAttribute("nullable-int48u") + ThermostatSetWeeklySchedule() + : ClusterCommand("set-weekly-schedule") + , mComplex_Payload(&mRequest.payload) { - AddArgument("attr-name", "nullable-int48u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - WriteAttribute::AddArguments(); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("NumberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence); + AddArgument("DayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence); + AddArgument("ModeForSequence", 0, UINT8_MAX, &mModeForSequence); + AddArgument("Payload", &mComplex_Payload); + ClusterCommand::AddArguments(); } - ~WriteTestClusterNullableInt48u() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs + __auto_type * params = [[CHIPThermostatClusterSetWeeklyScheduleParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - - [cluster writeAttributeNullableInt48uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt48u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + params.numberOfTransitionsForSequence = [NSNumber numberWithUnsignedChar:mNumberOfTransitionsForSequence]; + params.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:mDayOfWeekForSequence]; + params.modeForSequence = [NSNumber numberWithUnsignedChar:mModeForSequence]; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.payload) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + params.payload = array_0; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setWeeklyScheduleWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } return chipError; } private: - uint64_t mValue; + chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type mRequest; + uint8_t mNumberOfTransitionsForSequence; + uint8_t mDayOfWeekForSequence; + uint8_t mModeForSequence; + TypedComplexArgument> mComplex_Payload; }; -class SubscribeAttributeTestClusterNullableInt48u : public SubscribeAttribute { +/* + * Command GetWeeklySchedule + */ +class ThermostatGetWeeklySchedule : public ClusterCommand { public: - SubscribeAttributeTestClusterNullableInt48u() - : SubscribeAttribute("nullable-int48u") + ThermostatGetWeeklySchedule() + : ClusterCommand("get-weekly-schedule") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("DaysToReturn", 0, UINT8_MAX, &mDaysToReturn); + AddArgument("ModeToReturn", 0, UINT8_MAX, &mModeToReturn); + ClusterCommand::AddArguments(); } - ~SubscribeAttributeTestClusterNullableInt48u() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400A) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt48uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt48u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000002) on endpoint %u", endpointId); - return CHIP_NO_ERROR; + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPThermostatClusterGetWeeklyScheduleParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.daysToReturn = [NSNumber numberWithUnsignedChar:mDaysToReturn]; + params.modeToReturn = [NSNumber numberWithUnsignedChar:mModeToReturn]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster getWeeklyScheduleWithParams:params + completionHandler:^(CHIPThermostatClusterGetWeeklyScheduleResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type mRequest; + uint8_t mDaysToReturn; + uint8_t mModeToReturn; }; /* - * Attribute NullableInt56u + * Command ClearWeeklySchedule */ -class ReadTestClusterNullableInt56u : public ReadAttribute { +class ThermostatClearWeeklySchedule : public ClusterCommand { public: - ReadTestClusterNullableInt56u() - : ReadAttribute("nullable-int56u") + ThermostatClearWeeklySchedule() + : ClusterCommand("clear-weekly-schedule") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~ReadTestClusterNullableInt56u() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400B) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt56uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt56u response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt56u read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class WriteTestClusterNullableInt56u : public WriteAttribute { -public: - WriteTestClusterNullableInt56u() - : WriteAttribute("nullable-int56u") - { - AddArgument("attr-name", "nullable-int56u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt56u() {} + ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000003) on endpoint %u", endpointId); - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs + __auto_type * params = [[CHIPThermostatClusterClearWeeklyScheduleParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - - [cluster writeAttributeNullableInt56uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt56u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster clearWeeklyScheduleWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } return chipError; } private: - uint64_t mValue; + chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type mRequest; }; -class SubscribeAttributeTestClusterNullableInt56u : public SubscribeAttribute { +/* + * Command GetRelayStatusLog + */ +class ThermostatGetRelayStatusLog : public ClusterCommand { public: - SubscribeAttributeTestClusterNullableInt56u() - : SubscribeAttribute("nullable-int56u") + ThermostatGetRelayStatusLog() + : ClusterCommand("get-relay-status-log") { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); } - ~SubscribeAttributeTestClusterNullableInt56u() {} - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400B) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt56uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt56u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000004) on endpoint %u", endpointId); - return CHIP_NO_ERROR; + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPThermostatClusterGetRelayStatusLogParams 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 getRelayStatusLogWithCompletionHandler:^( + CHIPThermostatClusterGetRelayStatusLogResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; } - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } +private: + chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type mRequest; }; /* - * Attribute NullableInt64u + * Attribute LocalTemperature */ -class ReadTestClusterNullableInt64u : public ReadAttribute { +class ReadThermostatLocalTemperature : public ReadAttribute { public: - ReadTestClusterNullableInt64u() - : ReadAttribute("nullable-int64u") + ReadThermostatLocalTemperature() + : ReadAttribute("local-temperature") { } - ~ReadTestClusterNullableInt64u() {} + ~ReadThermostatLocalTemperature() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt64u response %@", [value description]); + [cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.LocalTemperature response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt64u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat LocalTemperature read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61680,74 +84583,34 @@ class ReadTestClusterNullableInt64u : public ReadAttribute { } }; -class WriteTestClusterNullableInt64u : public WriteAttribute { -public: - WriteTestClusterNullableInt64u() - : WriteAttribute("nullable-int64u") - { - AddArgument("attr-name", "nullable-int64u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt64u() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400C) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - - [cluster writeAttributeNullableInt64uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt64u write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint64_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt64u : public SubscribeAttribute { +class SubscribeAttributeThermostatLocalTemperature : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt64u() - : SubscribeAttribute("nullable-int64u") + SubscribeAttributeThermostatLocalTemperature() + : SubscribeAttribute("local-temperature") { } - ~SubscribeAttributeTestClusterNullableInt64u() {} + ~SubscribeAttributeThermostatLocalTemperature() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt64uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt64u response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeLocalTemperatureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.LocalTemperature response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -61759,30 +84622,30 @@ class SubscribeAttributeTestClusterNullableInt64u : public SubscribeAttribute { }; /* - * Attribute NullableInt8s + * Attribute OutdoorTemperature */ -class ReadTestClusterNullableInt8s : public ReadAttribute { +class ReadThermostatOutdoorTemperature : public ReadAttribute { public: - ReadTestClusterNullableInt8s() - : ReadAttribute("nullable-int8s") + ReadThermostatOutdoorTemperature() + : ReadAttribute("outdoor-temperature") { } - ~ReadTestClusterNullableInt8s() {} + ~ReadThermostatOutdoorTemperature() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt8s response %@", [value description]); + [cluster readAttributeOutdoorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.OutdoorTemperature response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt8s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat OutdoorTemperature read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61790,74 +84653,34 @@ class ReadTestClusterNullableInt8s : public ReadAttribute { } }; -class WriteTestClusterNullableInt8s : public WriteAttribute { -public: - WriteTestClusterNullableInt8s() - : WriteAttribute("nullable-int8s") - { - AddArgument("attr-name", "nullable-int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt8s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400D) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; - - [cluster writeAttributeNullableInt8sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt8s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int8_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt8s : public SubscribeAttribute { +class SubscribeAttributeThermostatOutdoorTemperature : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt8s() - : SubscribeAttribute("nullable-int8s") + SubscribeAttributeThermostatOutdoorTemperature() + : SubscribeAttribute("outdoor-temperature") { } - ~SubscribeAttributeTestClusterNullableInt8s() {} + ~SubscribeAttributeThermostatOutdoorTemperature() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400D) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt8s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOutdoorTemperatureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.OutdoorTemperature response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -61869,30 +84692,30 @@ class SubscribeAttributeTestClusterNullableInt8s : public SubscribeAttribute { }; /* - * Attribute NullableInt16s + * Attribute Occupancy */ -class ReadTestClusterNullableInt16s : public ReadAttribute { +class ReadThermostatOccupancy : public ReadAttribute { public: - ReadTestClusterNullableInt16s() - : ReadAttribute("nullable-int16s") + ReadThermostatOccupancy() + : ReadAttribute("occupancy") { } - ~ReadTestClusterNullableInt16s() {} + ~ReadThermostatOccupancy() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt16s response %@", [value description]); + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.Occupancy response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt16s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat Occupancy read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -61900,74 +84723,34 @@ class ReadTestClusterNullableInt16s : public ReadAttribute { } }; -class WriteTestClusterNullableInt16s : public WriteAttribute { -public: - WriteTestClusterNullableInt16s() - : WriteAttribute("nullable-int16s") - { - AddArgument("attr-name", "nullable-int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt16s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400E) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; - - [cluster writeAttributeNullableInt16sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt16s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int16_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt16s : public SubscribeAttribute { +class SubscribeAttributeThermostatOccupancy : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt16s() - : SubscribeAttribute("nullable-int16s") + SubscribeAttributeThermostatOccupancy() + : SubscribeAttribute("occupancy") { } - ~SubscribeAttributeTestClusterNullableInt16s() {} + ~SubscribeAttributeThermostatOccupancy() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt16s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOccupancyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.Occupancy response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -61979,105 +84762,67 @@ class SubscribeAttributeTestClusterNullableInt16s : public SubscribeAttribute { }; /* - * Attribute NullableInt24s + * Attribute AbsMinHeatSetpointLimit */ -class ReadTestClusterNullableInt24s : public ReadAttribute { +class ReadThermostatAbsMinHeatSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableInt24s() - : ReadAttribute("nullable-int24s") + ReadThermostatAbsMinHeatSetpointLimit() + : ReadAttribute("abs-min-heat-setpoint-limit") { } - ~ReadTestClusterNullableInt24s() {} + ~ReadThermostatAbsMinHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000400F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt24sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt24s response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; - - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt24s read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; - return err; - } -}; - -class WriteTestClusterNullableInt24s : public WriteAttribute { -public: - WriteTestClusterNullableInt24s() - : WriteAttribute("nullable-int24s") - { - AddArgument("attr-name", "nullable-int24s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt24s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000400F) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; + [cluster + readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - [cluster writeAttributeNullableInt24sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt24s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AbsMinHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; } - -private: - int32_t mValue; }; -class SubscribeAttributeTestClusterNullableInt24s : public SubscribeAttribute { +class SubscribeAttributeThermostatAbsMinHeatSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt24s() - : SubscribeAttribute("nullable-int24s") + SubscribeAttributeThermostatAbsMinHeatSetpointLimit() + : SubscribeAttribute("abs-min-heat-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableInt24s() {} + ~SubscribeAttributeThermostatAbsMinHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000400F) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt24sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt24s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAbsMinHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62089,105 +84834,67 @@ class SubscribeAttributeTestClusterNullableInt24s : public SubscribeAttribute { }; /* - * Attribute NullableInt32s + * Attribute AbsMaxHeatSetpointLimit */ -class ReadTestClusterNullableInt32s : public ReadAttribute { +class ReadThermostatAbsMaxHeatSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableInt32s() - : ReadAttribute("nullable-int32s") + ReadThermostatAbsMaxHeatSetpointLimit() + : ReadAttribute("abs-max-heat-setpoint-limit") { } - ~ReadTestClusterNullableInt32s() {} + ~ReadThermostatAbsMaxHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt32s response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt32s read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AbsMaxHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableInt32s : public WriteAttribute { -public: - WriteTestClusterNullableInt32s() - : WriteAttribute("nullable-int32s") - { - AddArgument("attr-name", "nullable-int32s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt32s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004010) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; - - [cluster writeAttributeNullableInt32sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt32s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int32_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt32s : public SubscribeAttribute { +class SubscribeAttributeThermostatAbsMaxHeatSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt32s() - : SubscribeAttribute("nullable-int32s") + SubscribeAttributeThermostatAbsMaxHeatSetpointLimit() + : SubscribeAttribute("abs-max-heat-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableInt32s() {} + ~SubscribeAttributeThermostatAbsMaxHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004010) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt32sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt32s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAbsMaxHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62199,105 +84906,67 @@ class SubscribeAttributeTestClusterNullableInt32s : public SubscribeAttribute { }; /* - * Attribute NullableInt40s + * Attribute AbsMinCoolSetpointLimit */ -class ReadTestClusterNullableInt40s : public ReadAttribute { +class ReadThermostatAbsMinCoolSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableInt40s() - : ReadAttribute("nullable-int40s") + ReadThermostatAbsMinCoolSetpointLimit() + : ReadAttribute("abs-min-cool-setpoint-limit") { } - ~ReadTestClusterNullableInt40s() {} + ~ReadThermostatAbsMinCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt40sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt40s response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt40s read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AbsMinCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableInt40s : public WriteAttribute { -public: - WriteTestClusterNullableInt40s() - : WriteAttribute("nullable-int40s") - { - AddArgument("attr-name", "nullable-int40s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt40s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004011) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - - [cluster writeAttributeNullableInt40sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt40s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int64_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt40s : public SubscribeAttribute { +class SubscribeAttributeThermostatAbsMinCoolSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt40s() - : SubscribeAttribute("nullable-int40s") + SubscribeAttributeThermostatAbsMinCoolSetpointLimit() + : SubscribeAttribute("abs-min-cool-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableInt40s() {} + ~SubscribeAttributeThermostatAbsMinCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt40sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt40s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAbsMinCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62309,105 +84978,67 @@ class SubscribeAttributeTestClusterNullableInt40s : public SubscribeAttribute { }; /* - * Attribute NullableInt48s + * Attribute AbsMaxCoolSetpointLimit */ -class ReadTestClusterNullableInt48s : public ReadAttribute { +class ReadThermostatAbsMaxCoolSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableInt48s() - : ReadAttribute("nullable-int48s") + ReadThermostatAbsMaxCoolSetpointLimit() + : ReadAttribute("abs-max-cool-setpoint-limit") { } - ~ReadTestClusterNullableInt48s() {} + ~ReadThermostatAbsMaxCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt48sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt48s response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt48s read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AbsMaxCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableInt48s : public WriteAttribute { -public: - WriteTestClusterNullableInt48s() - : WriteAttribute("nullable-int48s") - { - AddArgument("attr-name", "nullable-int48s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt48s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004012) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - - [cluster writeAttributeNullableInt48sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt48s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int64_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt48s : public SubscribeAttribute { +class SubscribeAttributeThermostatAbsMaxCoolSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt48s() - : SubscribeAttribute("nullable-int48s") + SubscribeAttributeThermostatAbsMaxCoolSetpointLimit() + : SubscribeAttribute("abs-max-cool-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableInt48s() {} + ~SubscribeAttributeThermostatAbsMaxCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000006) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt48sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt48s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAbsMaxCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62419,30 +85050,30 @@ class SubscribeAttributeTestClusterNullableInt48s : public SubscribeAttribute { }; /* - * Attribute NullableInt56s + * Attribute PiCoolingDemand */ -class ReadTestClusterNullableInt56s : public ReadAttribute { +class ReadThermostatPiCoolingDemand : public ReadAttribute { public: - ReadTestClusterNullableInt56s() - : ReadAttribute("nullable-int56s") + ReadThermostatPiCoolingDemand() + : ReadAttribute("pi-cooling-demand") { } - ~ReadTestClusterNullableInt56s() {} + ~ReadThermostatPiCoolingDemand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt56sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt56s response %@", [value description]); + [cluster readAttributePiCoolingDemandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.PiCoolingDemand response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt56s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat PiCoolingDemand read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -62450,74 +85081,34 @@ class ReadTestClusterNullableInt56s : public ReadAttribute { } }; -class WriteTestClusterNullableInt56s : public WriteAttribute { -public: - WriteTestClusterNullableInt56s() - : WriteAttribute("nullable-int56s") - { - AddArgument("attr-name", "nullable-int56s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt56s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004013) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - - [cluster writeAttributeNullableInt56sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt56s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int64_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt56s : public SubscribeAttribute { +class SubscribeAttributeThermostatPiCoolingDemand : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt56s() - : SubscribeAttribute("nullable-int56s") + SubscribeAttributeThermostatPiCoolingDemand() + : SubscribeAttribute("pi-cooling-demand") { } - ~SubscribeAttributeTestClusterNullableInt56s() {} + ~SubscribeAttributeThermostatPiCoolingDemand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004013) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000007) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt56sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt56s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePiCoolingDemandWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.PiCoolingDemand response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62529,30 +85120,30 @@ class SubscribeAttributeTestClusterNullableInt56s : public SubscribeAttribute { }; /* - * Attribute NullableInt64s + * Attribute PiHeatingDemand */ -class ReadTestClusterNullableInt64s : public ReadAttribute { +class ReadThermostatPiHeatingDemand : public ReadAttribute { public: - ReadTestClusterNullableInt64s() - : ReadAttribute("nullable-int64s") + ReadThermostatPiHeatingDemand() + : ReadAttribute("pi-heating-demand") { } - ~ReadTestClusterNullableInt64s() {} + ~ReadThermostatPiHeatingDemand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt64s response %@", [value description]); + [cluster readAttributePiHeatingDemandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.PiHeatingDemand response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableInt64s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat PiHeatingDemand read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -62560,74 +85151,34 @@ class ReadTestClusterNullableInt64s : public ReadAttribute { } }; -class WriteTestClusterNullableInt64s : public WriteAttribute { -public: - WriteTestClusterNullableInt64s() - : WriteAttribute("nullable-int64s") - { - AddArgument("attr-name", "nullable-int64s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteTestClusterNullableInt64s() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004014) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; - - [cluster writeAttributeNullableInt64sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableInt64s write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int64_t mValue; -}; - -class SubscribeAttributeTestClusterNullableInt64s : public SubscribeAttribute { +class SubscribeAttributeThermostatPiHeatingDemand : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableInt64s() - : SubscribeAttribute("nullable-int64s") + SubscribeAttributeThermostatPiHeatingDemand() + : SubscribeAttribute("pi-heating-demand") { } - ~SubscribeAttributeTestClusterNullableInt64s() {} + ~SubscribeAttributeThermostatPiHeatingDemand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004014) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableInt64sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableInt64s response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributePiHeatingDemandWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.PiHeatingDemand response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62639,70 +85190,72 @@ class SubscribeAttributeTestClusterNullableInt64s : public SubscribeAttribute { }; /* - * Attribute NullableEnum8 + * Attribute HvacSystemTypeConfiguration */ -class ReadTestClusterNullableEnum8 : public ReadAttribute { +class ReadThermostatHvacSystemTypeConfiguration : public ReadAttribute { public: - ReadTestClusterNullableEnum8() - : ReadAttribute("nullable-enum8") + ReadThermostatHvacSystemTypeConfiguration() + : ReadAttribute("hvac-system-type-configuration") { } - ~ReadTestClusterNullableEnum8() {} + ~ReadThermostatHvacSystemTypeConfiguration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableEnum8 response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeHvacSystemTypeConfigurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.HvacSystemTypeConfiguration response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableEnum8 read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat HvacSystemTypeConfiguration read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableEnum8 : public WriteAttribute { +class WriteThermostatHvacSystemTypeConfiguration : public WriteAttribute { public: - WriteTestClusterNullableEnum8() - : WriteAttribute("nullable-enum8") + WriteThermostatHvacSystemTypeConfiguration() + : WriteAttribute("hvac-system-type-configuration") { - AddArgument("attr-name", "nullable-enum8"); + AddArgument("attr-name", "hvac-system-type-configuration"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableEnum8() {} + ~WriteThermostatHvacSystemTypeConfiguration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeNullableEnum8WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableEnum8 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeHvacSystemTypeConfigurationWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "Thermostat HvacSystemTypeConfiguration write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -62710,34 +85263,36 @@ class WriteTestClusterNullableEnum8 : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeTestClusterNullableEnum8 : public SubscribeAttribute { +class SubscribeAttributeThermostatHvacSystemTypeConfiguration : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableEnum8() - : SubscribeAttribute("nullable-enum8") + SubscribeAttributeThermostatHvacSystemTypeConfiguration() + : SubscribeAttribute("hvac-system-type-configuration") { } - ~SubscribeAttributeTestClusterNullableEnum8() {} + ~SubscribeAttributeThermostatHvacSystemTypeConfiguration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000009) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableEnum8WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableEnum8 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeHvacSystemTypeConfigurationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.HvacSystemTypeConfiguration response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62749,105 +85304,109 @@ class SubscribeAttributeTestClusterNullableEnum8 : public SubscribeAttribute { }; /* - * Attribute NullableEnum16 + * Attribute LocalTemperatureCalibration */ -class ReadTestClusterNullableEnum16 : public ReadAttribute { +class ReadThermostatLocalTemperatureCalibration : public ReadAttribute { public: - ReadTestClusterNullableEnum16() - : ReadAttribute("nullable-enum16") + ReadThermostatLocalTemperatureCalibration() + : ReadAttribute("local-temperature-calibration") { } - ~ReadTestClusterNullableEnum16() {} + ~ReadThermostatLocalTemperatureCalibration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableEnum16 response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeLocalTemperatureCalibrationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.LocalTemperatureCalibration response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableEnum16 read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat LocalTemperatureCalibration read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableEnum16 : public WriteAttribute { +class WriteThermostatLocalTemperatureCalibration : public WriteAttribute { public: - WriteTestClusterNullableEnum16() - : WriteAttribute("nullable-enum16") + WriteThermostatLocalTemperatureCalibration() + : WriteAttribute("local-temperature-calibration") { - AddArgument("attr-name", "nullable-enum16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); + AddArgument("attr-name", "local-temperature-calibration"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableEnum16() {} + ~WriteThermostatLocalTemperatureCalibration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; - [cluster writeAttributeNullableEnum16WithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableEnum16 write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeLocalTemperatureCalibrationWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "Thermostat LocalTemperatureCalibration write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint16_t mValue; + int8_t mValue; }; -class SubscribeAttributeTestClusterNullableEnum16 : public SubscribeAttribute { +class SubscribeAttributeThermostatLocalTemperatureCalibration : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableEnum16() - : SubscribeAttribute("nullable-enum16") + SubscribeAttributeThermostatLocalTemperatureCalibration() + : SubscribeAttribute("local-temperature-calibration") { } - ~SubscribeAttributeTestClusterNullableEnum16() {} + ~SubscribeAttributeThermostatLocalTemperatureCalibration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableEnum16WithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableEnum16 response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeLocalTemperatureCalibrationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.LocalTemperatureCalibration response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62859,106 +85418,107 @@ class SubscribeAttributeTestClusterNullableEnum16 : public SubscribeAttribute { }; /* - * Attribute NullableFloatSingle + * Attribute OccupiedCoolingSetpoint */ -class ReadTestClusterNullableFloatSingle : public ReadAttribute { +class ReadThermostatOccupiedCoolingSetpoint : public ReadAttribute { public: - ReadTestClusterNullableFloatSingle() - : ReadAttribute("nullable-float-single") + ReadThermostatOccupiedCoolingSetpoint() + : ReadAttribute("occupied-cooling-setpoint") { } - ~ReadTestClusterNullableFloatSingle() {} + ~ReadThermostatOccupiedCoolingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableFloatSingle response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableFloatSingle read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat OccupiedCoolingSetpoint read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableFloatSingle : public WriteAttribute { +class WriteThermostatOccupiedCoolingSetpoint : public WriteAttribute { public: - WriteTestClusterNullableFloatSingle() - : WriteAttribute("nullable-float-single") + WriteThermostatOccupiedCoolingSetpoint() + : WriteAttribute("occupied-cooling-setpoint") { - AddArgument("attr-name", "nullable-float-single"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); + AddArgument("attr-name", "occupied-cooling-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableFloatSingle() {} + ~WriteThermostatOccupiedCoolingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithFloat:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableFloatSingleWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableFloatSingle write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat OccupiedCoolingSetpoint write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - float mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableFloatSingle : public SubscribeAttribute { +class SubscribeAttributeThermostatOccupiedCoolingSetpoint : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableFloatSingle() - : SubscribeAttribute("nullable-float-single") + SubscribeAttributeThermostatOccupiedCoolingSetpoint() + : SubscribeAttribute("occupied-cooling-setpoint") { } - ~SubscribeAttributeTestClusterNullableFloatSingle() {} + ~SubscribeAttributeThermostatOccupiedCoolingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000011) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNullableFloatSingleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableFloatSingle response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOccupiedCoolingSetpointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -62970,106 +85530,107 @@ class SubscribeAttributeTestClusterNullableFloatSingle : public SubscribeAttribu }; /* - * Attribute NullableFloatDouble + * Attribute OccupiedHeatingSetpoint */ -class ReadTestClusterNullableFloatDouble : public ReadAttribute { +class ReadThermostatOccupiedHeatingSetpoint : public ReadAttribute { public: - ReadTestClusterNullableFloatDouble() - : ReadAttribute("nullable-float-double") + ReadThermostatOccupiedHeatingSetpoint() + : ReadAttribute("occupied-heating-setpoint") { } - ~ReadTestClusterNullableFloatDouble() {} + ~ReadThermostatOccupiedHeatingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableFloatDouble response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableFloatDouble read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat OccupiedHeatingSetpoint read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableFloatDouble : public WriteAttribute { +class WriteThermostatOccupiedHeatingSetpoint : public WriteAttribute { public: - WriteTestClusterNullableFloatDouble() - : WriteAttribute("nullable-float-double") + WriteThermostatOccupiedHeatingSetpoint() + : WriteAttribute("occupied-heating-setpoint") { - AddArgument("attr-name", "nullable-float-double"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); + AddArgument("attr-name", "occupied-heating-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableFloatDouble() {} + ~WriteThermostatOccupiedHeatingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithDouble:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableFloatDoubleWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableFloatDouble write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat OccupiedHeatingSetpoint write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - double mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableFloatDouble : public SubscribeAttribute { +class SubscribeAttributeThermostatOccupiedHeatingSetpoint : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableFloatDouble() - : SubscribeAttribute("nullable-float-double") + SubscribeAttributeThermostatOccupiedHeatingSetpoint() + : SubscribeAttribute("occupied-heating-setpoint") { } - ~SubscribeAttributeTestClusterNullableFloatDouble() {} + ~SubscribeAttributeThermostatOccupiedHeatingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000012) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNullableFloatDoubleWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableFloatDouble response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeOccupiedHeatingSetpointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63081,106 +85642,109 @@ class SubscribeAttributeTestClusterNullableFloatDouble : public SubscribeAttribu }; /* - * Attribute NullableOctetString + * Attribute UnoccupiedCoolingSetpoint */ -class ReadTestClusterNullableOctetString : public ReadAttribute { +class ReadThermostatUnoccupiedCoolingSetpoint : public ReadAttribute { public: - ReadTestClusterNullableOctetString() - : ReadAttribute("nullable-octet-string") + ReadThermostatUnoccupiedCoolingSetpoint() + : ReadAttribute("unoccupied-cooling-setpoint") { } - ~ReadTestClusterNullableOctetString() {} + ~ReadThermostatUnoccupiedCoolingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableOctetString response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeUnoccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.UnoccupiedCoolingSetpoint response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableOctetString read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat UnoccupiedCoolingSetpoint read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableOctetString : public WriteAttribute { +class WriteThermostatUnoccupiedCoolingSetpoint : public WriteAttribute { public: - WriteTestClusterNullableOctetString() - : WriteAttribute("nullable-octet-string") + WriteThermostatUnoccupiedCoolingSetpoint() + : WriteAttribute("unoccupied-cooling-setpoint") { - AddArgument("attr-name", "nullable-octet-string"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "unoccupied-cooling-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableOctetString() {} + ~WriteThermostatUnoccupiedCoolingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSData * _Nullable value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableOctetStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableOctetString write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster + writeAttributeUnoccupiedCoolingSetpointWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat UnoccupiedCoolingSetpoint write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableOctetString : public SubscribeAttribute { +class SubscribeAttributeThermostatUnoccupiedCoolingSetpoint : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableOctetString() - : SubscribeAttribute("nullable-octet-string") + SubscribeAttributeThermostatUnoccupiedCoolingSetpoint() + : SubscribeAttribute("unoccupied-cooling-setpoint") { } - ~SubscribeAttributeTestClusterNullableOctetString() {} + ~SubscribeAttributeThermostatUnoccupiedCoolingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000013) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeNullableOctetStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableOctetString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeUnoccupiedCoolingSetpointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.UnoccupiedCoolingSetpoint response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63192,108 +85756,109 @@ class SubscribeAttributeTestClusterNullableOctetString : public SubscribeAttribu }; /* - * Attribute NullableCharString + * Attribute UnoccupiedHeatingSetpoint */ -class ReadTestClusterNullableCharString : public ReadAttribute { +class ReadThermostatUnoccupiedHeatingSetpoint : public ReadAttribute { public: - ReadTestClusterNullableCharString() - : ReadAttribute("nullable-char-string") + ReadThermostatUnoccupiedHeatingSetpoint() + : ReadAttribute("unoccupied-heating-setpoint") { } - ~ReadTestClusterNullableCharString() {} + ~ReadThermostatUnoccupiedHeatingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000401E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableCharString response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeUnoccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.UnoccupiedHeatingSetpoint response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableCharString read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat UnoccupiedHeatingSetpoint read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteTestClusterNullableCharString : public WriteAttribute { +class WriteThermostatUnoccupiedHeatingSetpoint : public WriteAttribute { public: - WriteTestClusterNullableCharString() - : WriteAttribute("nullable-char-string") + WriteThermostatUnoccupiedHeatingSetpoint() + : WriteAttribute("unoccupied-heating-setpoint") { - AddArgument("attr-name", "nullable-char-string"); - AddArgument("attr-value", &mValue); + AddArgument("attr-name", "unoccupied-heating-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableCharString() {} + ~WriteThermostatUnoccupiedHeatingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000401E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSString * _Nullable value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableCharStringWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableCharString write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster + writeAttributeUnoccupiedHeatingSetpointWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat UnoccupiedHeatingSetpoint write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::ByteSpan mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableCharString : public SubscribeAttribute { +class SubscribeAttributeThermostatUnoccupiedHeatingSetpoint : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableCharString() - : SubscribeAttribute("nullable-char-string") + SubscribeAttributeThermostatUnoccupiedHeatingSetpoint() + : SubscribeAttribute("unoccupied-heating-setpoint") { } - ~SubscribeAttributeTestClusterNullableCharString() {} + ~SubscribeAttributeThermostatUnoccupiedHeatingSetpoint() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000401E) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000014) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeNullableCharStringWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableCharString response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeUnoccupiedHeatingSetpointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.UnoccupiedHeatingSetpoint response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63305,30 +85870,30 @@ class SubscribeAttributeTestClusterNullableCharString : public SubscribeAttribut }; /* - * Attribute NullableEnumAttr + * Attribute MinHeatSetpointLimit */ -class ReadTestClusterNullableEnumAttr : public ReadAttribute { +class ReadThermostatMinHeatSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableEnumAttr() - : ReadAttribute("nullable-enum-attr") + ReadThermostatMinHeatSetpointLimit() + : ReadAttribute("min-heat-setpoint-limit") { } - ~ReadTestClusterNullableEnumAttr() {} + ~ReadThermostatMinHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableEnumAttr response %@", [value description]); + [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableEnumAttr read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat MinHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -63336,74 +85901,75 @@ class ReadTestClusterNullableEnumAttr : public ReadAttribute { } }; -class WriteTestClusterNullableEnumAttr : public WriteAttribute { +class WriteThermostatMinHeatSetpointLimit : public WriteAttribute { public: - WriteTestClusterNullableEnumAttr() - : WriteAttribute("nullable-enum-attr") + WriteThermostatMinHeatSetpointLimit() + : WriteAttribute("min-heat-setpoint-limit") { - AddArgument("attr-name", "nullable-enum-attr"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "min-heat-setpoint-limit"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableEnumAttr() {} + ~WriteThermostatMinHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableEnumAttrWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableEnumAttr write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat MinHeatSetpointLimit write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint8_t mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableEnumAttr : public SubscribeAttribute { +class SubscribeAttributeThermostatMinHeatSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableEnumAttr() - : SubscribeAttribute("nullable-enum-attr") + SubscribeAttributeThermostatMinHeatSetpointLimit() + : SubscribeAttribute("min-heat-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableEnumAttr() {} + ~SubscribeAttributeThermostatMinHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004024) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000015) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableEnumAttrWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableEnumAttr response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMinHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63415,31 +85981,30 @@ class SubscribeAttributeTestClusterNullableEnumAttr : public SubscribeAttribute }; /* - * Attribute NullableStruct + * Attribute MaxHeatSetpointLimit */ -class ReadTestClusterNullableStruct : public ReadAttribute { +class ReadThermostatMaxHeatSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableStruct() - : ReadAttribute("nullable-struct") + ReadThermostatMaxHeatSetpointLimit() + : ReadAttribute("max-heat-setpoint-limit") { } - ~ReadTestClusterNullableStruct() {} + ~ReadThermostatMaxHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableStructWithCompletionHandler:^( - CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableStruct response %@", [value description]); + [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableStruct read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat MaxHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -63447,92 +86012,75 @@ class ReadTestClusterNullableStruct : public ReadAttribute { } }; -class WriteTestClusterNullableStruct : public WriteAttribute { +class WriteThermostatMaxHeatSetpointLimit : public WriteAttribute { public: - WriteTestClusterNullableStruct() - : WriteAttribute("nullable-struct") - , mComplex(&mValue) + WriteThermostatMaxHeatSetpointLimit() + : WriteAttribute("max-heat-setpoint-limit") { - AddArgument("attr-name", "nullable-struct"); - AddArgument("attr-value", &mComplex); + AddArgument("attr-name", "max-heat-setpoint-limit"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableStruct() {} + ~WriteThermostatMaxHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - CHIPTestClusterClusterSimpleStruct * _Nullable value; - if (mValue.IsNull()) { - value = nil; - } else { - value = [CHIPTestClusterClusterSimpleStruct new]; - value.a = [NSNumber numberWithUnsignedChar:mValue.Value().a]; - value.b = [NSNumber numberWithBool:mValue.Value().b]; - value.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().c)]; - value.d = [NSData dataWithBytes:mValue.Value().d.data() length:mValue.Value().d.size()]; - value.e = [[NSString alloc] initWithBytes:mValue.Value().e.data() - length:mValue.Value().e.size() - encoding:NSUTF8StringEncoding]; - value.f = [NSNumber numberWithUnsignedChar:mValue.Value().f.Raw()]; - value.g = [NSNumber numberWithFloat:mValue.Value().g]; - value.h = [NSNumber numberWithDouble:mValue.Value().h]; - } + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableStructWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError( - chipTool, "TestCluster NullableStruct write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat MaxHeatSetpointLimit write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - chip::app::DataModel::Nullable mValue; - TypedComplexArgument> mComplex; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableStruct : public SubscribeAttribute { +class SubscribeAttributeThermostatMaxHeatSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableStruct() - : SubscribeAttribute("nullable-struct") + SubscribeAttributeThermostatMaxHeatSetpointLimit() + : SubscribeAttribute("max-heat-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableStruct() {} + ~SubscribeAttributeThermostatMaxHeatSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004025) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000016) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeNullableStructWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(CHIPTestClusterClusterSimpleStruct * _Nullable value, - NSError * _Nullable error) { - NSLog(@"TestCluster.NullableStruct response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeMaxHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63544,31 +86092,30 @@ class SubscribeAttributeTestClusterNullableStruct : public SubscribeAttribute { }; /* - * Attribute NullableRangeRestrictedInt8u + * Attribute MinCoolSetpointLimit */ -class ReadTestClusterNullableRangeRestrictedInt8u : public ReadAttribute { +class ReadThermostatMinCoolSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableRangeRestrictedInt8u() - : ReadAttribute("nullable-range-restricted-int8u") + ReadThermostatMinCoolSetpointLimit() + : ReadAttribute("min-cool-setpoint-limit") { } - ~ReadTestClusterNullableRangeRestrictedInt8u() {} + ~ReadThermostatMinCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt8u response %@", [value description]); + [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt8u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat MinCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -63576,77 +86123,75 @@ class ReadTestClusterNullableRangeRestrictedInt8u : public ReadAttribute { } }; -class WriteTestClusterNullableRangeRestrictedInt8u : public WriteAttribute { +class WriteThermostatMinCoolSetpointLimit : public WriteAttribute { public: - WriteTestClusterNullableRangeRestrictedInt8u() - : WriteAttribute("nullable-range-restricted-int8u") + WriteThermostatMinCoolSetpointLimit() + : WriteAttribute("min-cool-setpoint-limit") { - AddArgument("attr-name", "nullable-range-restricted-int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "min-cool-setpoint-limit"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableRangeRestrictedInt8u() {} + ~WriteThermostatMinCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "TestCluster NullableRangeRestrictedInt8u write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat MinCoolSetpointLimit write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint8_t mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableRangeRestrictedInt8u : public SubscribeAttribute { +class SubscribeAttributeThermostatMinCoolSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableRangeRestrictedInt8u() - : SubscribeAttribute("nullable-range-restricted-int8u") + SubscribeAttributeThermostatMinCoolSetpointLimit() + : SubscribeAttribute("min-cool-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableRangeRestrictedInt8u() {} + ~SubscribeAttributeThermostatMinCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004026) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000017) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeNullableRangeRestrictedInt8uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt8u response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeMinCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63658,31 +86203,30 @@ class SubscribeAttributeTestClusterNullableRangeRestrictedInt8u : public Subscri }; /* - * Attribute NullableRangeRestrictedInt8s + * Attribute MaxCoolSetpointLimit */ -class ReadTestClusterNullableRangeRestrictedInt8s : public ReadAttribute { +class ReadThermostatMaxCoolSetpointLimit : public ReadAttribute { public: - ReadTestClusterNullableRangeRestrictedInt8s() - : ReadAttribute("nullable-range-restricted-int8s") + ReadThermostatMaxCoolSetpointLimit() + : ReadAttribute("max-cool-setpoint-limit") { } - ~ReadTestClusterNullableRangeRestrictedInt8s() {} + ~ReadThermostatMaxCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004027) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt8s response %@", [value description]); + [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt8s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat MaxCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -63690,77 +86234,75 @@ class ReadTestClusterNullableRangeRestrictedInt8s : public ReadAttribute { } }; -class WriteTestClusterNullableRangeRestrictedInt8s : public WriteAttribute { +class WriteThermostatMaxCoolSetpointLimit : public WriteAttribute { public: - WriteTestClusterNullableRangeRestrictedInt8s() - : WriteAttribute("nullable-range-restricted-int8s") + WriteThermostatMaxCoolSetpointLimit() + : WriteAttribute("max-cool-setpoint-limit") { - AddArgument("attr-name", "nullable-range-restricted-int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + AddArgument("attr-name", "max-cool-setpoint-limit"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableRangeRestrictedInt8s() {} + ~WriteThermostatMaxCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004027) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "TestCluster NullableRangeRestrictedInt8s write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat MaxCoolSetpointLimit write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int8_t mValue; + int16_t mValue; }; -class SubscribeAttributeTestClusterNullableRangeRestrictedInt8s : public SubscribeAttribute { +class SubscribeAttributeThermostatMaxCoolSetpointLimit : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableRangeRestrictedInt8s() - : SubscribeAttribute("nullable-range-restricted-int8s") + SubscribeAttributeThermostatMaxCoolSetpointLimit() + : SubscribeAttribute("max-cool-setpoint-limit") { } - ~SubscribeAttributeTestClusterNullableRangeRestrictedInt8s() {} + ~SubscribeAttributeThermostatMaxCoolSetpointLimit() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004027) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000018) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeNullableRangeRestrictedInt8sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt8s response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeMaxCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63772,31 +86314,30 @@ class SubscribeAttributeTestClusterNullableRangeRestrictedInt8s : public Subscri }; /* - * Attribute NullableRangeRestrictedInt16u + * Attribute MinSetpointDeadBand */ -class ReadTestClusterNullableRangeRestrictedInt16u : public ReadAttribute { +class ReadThermostatMinSetpointDeadBand : public ReadAttribute { public: - ReadTestClusterNullableRangeRestrictedInt16u() - : ReadAttribute("nullable-range-restricted-int16u") + ReadThermostatMinSetpointDeadBand() + : ReadAttribute("min-setpoint-dead-band") { } - ~ReadTestClusterNullableRangeRestrictedInt16u() {} + ~ReadThermostatMinSetpointDeadBand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004028) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt16u response %@", [value description]); + [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt16u read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat MinSetpointDeadBand read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -63804,78 +86345,75 @@ class ReadTestClusterNullableRangeRestrictedInt16u : public ReadAttribute { } }; -class WriteTestClusterNullableRangeRestrictedInt16u : public WriteAttribute { +class WriteThermostatMinSetpointDeadBand : public WriteAttribute { public: - WriteTestClusterNullableRangeRestrictedInt16u() - : WriteAttribute("nullable-range-restricted-int16u") + WriteThermostatMinSetpointDeadBand() + : WriteAttribute("min-setpoint-dead-band") { - AddArgument("attr-name", "nullable-range-restricted-int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); + AddArgument("attr-name", "min-setpoint-dead-band"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableRangeRestrictedInt16u() {} + ~WriteThermostatMinSetpointDeadBand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004028) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; - [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "TestCluster NullableRangeRestrictedInt16u write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeMinSetpointDeadBandWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat MinSetpointDeadBand write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - uint16_t mValue; + int8_t mValue; }; -class SubscribeAttributeTestClusterNullableRangeRestrictedInt16u : public SubscribeAttribute { +class SubscribeAttributeThermostatMinSetpointDeadBand : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableRangeRestrictedInt16u() - : SubscribeAttribute("nullable-range-restricted-int16u") + SubscribeAttributeThermostatMinSetpointDeadBand() + : SubscribeAttribute("min-setpoint-dead-band") { } - ~SubscribeAttributeTestClusterNullableRangeRestrictedInt16u() {} + ~SubscribeAttributeThermostatMinSetpointDeadBand() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004028) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000019) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNullableRangeRestrictedInt16uWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt16u response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeMinSetpointDeadBandWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -63887,31 +86425,30 @@ class SubscribeAttributeTestClusterNullableRangeRestrictedInt16u : public Subscr }; /* - * Attribute NullableRangeRestrictedInt16s + * Attribute RemoteSensing */ -class ReadTestClusterNullableRangeRestrictedInt16s : public ReadAttribute { +class ReadThermostatRemoteSensing : public ReadAttribute { public: - ReadTestClusterNullableRangeRestrictedInt16s() - : ReadAttribute("nullable-range-restricted-int16s") + ReadThermostatRemoteSensing() + : ReadAttribute("remote-sensing") { } - ~ReadTestClusterNullableRangeRestrictedInt16s() {} + ~ReadThermostatRemoteSensing() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00004029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt16s response %@", [value description]); + [cluster readAttributeRemoteSensingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.RemoteSensing response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt16s read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat RemoteSensing read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -63919,78 +86456,74 @@ class ReadTestClusterNullableRangeRestrictedInt16s : public ReadAttribute { } }; -class WriteTestClusterNullableRangeRestrictedInt16s : public WriteAttribute { +class WriteThermostatRemoteSensing : public WriteAttribute { public: - WriteTestClusterNullableRangeRestrictedInt16s() - : WriteAttribute("nullable-range-restricted-int16s") + WriteThermostatRemoteSensing() + : WriteAttribute("remote-sensing") { - AddArgument("attr-name", "nullable-range-restricted-int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "remote-sensing"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteTestClusterNullableRangeRestrictedInt16s() {} + ~WriteThermostatRemoteSensing() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00004029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, - "TestCluster NullableRangeRestrictedInt16s write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeRemoteSensingWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError( + chipTool, "Thermostat RemoteSensing write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + uint8_t mValue; }; -class SubscribeAttributeTestClusterNullableRangeRestrictedInt16s : public SubscribeAttribute { +class SubscribeAttributeThermostatRemoteSensing : public SubscribeAttribute { public: - SubscribeAttributeTestClusterNullableRangeRestrictedInt16s() - : SubscribeAttribute("nullable-range-restricted-int16s") + SubscribeAttributeThermostatRemoteSensing() + : SubscribeAttribute("remote-sensing") { } - ~SubscribeAttributeTestClusterNullableRangeRestrictedInt16s() {} + ~SubscribeAttributeThermostatRemoteSensing() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00004029) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001A) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeNullableRangeRestrictedInt16sWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^( - NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.NullableRangeRestrictedInt16s response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeRemoteSensingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.RemoteSensing response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64002,66 +86535,109 @@ class SubscribeAttributeTestClusterNullableRangeRestrictedInt16s : public Subscr }; /* - * Attribute GeneratedCommandList + * Attribute ControlSequenceOfOperation */ -class ReadTestClusterGeneratedCommandList : public ReadAttribute { +class ReadThermostatControlSequenceOfOperation : public ReadAttribute { public: - ReadTestClusterGeneratedCommandList() - : ReadAttribute("generated-command-list") + ReadThermostatControlSequenceOfOperation() + : ReadAttribute("control-sequence-of-operation") { } - ~ReadTestClusterGeneratedCommandList() {} + ~ReadThermostatControlSequenceOfOperation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.GeneratedCommandList response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ControlSequenceOfOperation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "TestCluster GeneratedCommandList read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat ControlSequenceOfOperation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeTestClusterGeneratedCommandList : public SubscribeAttribute { +class WriteThermostatControlSequenceOfOperation : public WriteAttribute { public: - SubscribeAttributeTestClusterGeneratedCommandList() - : SubscribeAttribute("generated-command-list") + WriteThermostatControlSequenceOfOperation() + : WriteAttribute("control-sequence-of-operation") { + AddArgument("attr-name", "control-sequence-of-operation"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTestClusterGeneratedCommandList() {} + ~WriteThermostatControlSequenceOfOperation() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001B) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster + writeAttributeControlSequenceOfOperationWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat ControlSequenceOfOperation write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeThermostatControlSequenceOfOperation : public SubscribeAttribute { +public: + SubscribeAttributeThermostatControlSequenceOfOperation() + : SubscribeAttribute("control-sequence-of-operation") + { + } + + ~SubscribeAttributeThermostatControlSequenceOfOperation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.GeneratedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeControlSequenceOfOperationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ControlSequenceOfOperation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64073,30 +86649,30 @@ class SubscribeAttributeTestClusterGeneratedCommandList : public SubscribeAttrib }; /* - * Attribute AcceptedCommandList + * Attribute SystemMode */ -class ReadTestClusterAcceptedCommandList : public ReadAttribute { +class ReadThermostatSystemMode : public ReadAttribute { public: - ReadTestClusterAcceptedCommandList() - : ReadAttribute("accepted-command-list") + ReadThermostatSystemMode() + : ReadAttribute("system-mode") { } - ~ReadTestClusterAcceptedCommandList() {} + ~ReadThermostatSystemMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.AcceptedCommandList response %@", [value description]); + [cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SystemMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat SystemMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -64104,35 +86680,73 @@ class ReadTestClusterAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeTestClusterAcceptedCommandList : public SubscribeAttribute { +class WriteThermostatSystemMode : public WriteAttribute { public: - SubscribeAttributeTestClusterAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") + WriteThermostatSystemMode() + : WriteAttribute("system-mode") { + AddArgument("attr-name", "system-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeTestClusterAcceptedCommandList() {} + ~WriteThermostatSystemMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001C) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSystemModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat SystemMode write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeThermostatSystemMode : public SubscribeAttribute { +public: + SubscribeAttributeThermostatSystemMode() + : SubscribeAttribute("system-mode") + { + } + + ~SubscribeAttributeThermostatSystemMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.AcceptedCommandList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeSystemModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SystemMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64144,30 +86758,30 @@ class SubscribeAttributeTestClusterAcceptedCommandList : public SubscribeAttribu }; /* - * Attribute AttributeList + * Attribute AlarmMask */ -class ReadTestClusterAttributeList : public ReadAttribute { +class ReadThermostatAlarmMask : public ReadAttribute { public: - ReadTestClusterAttributeList() - : ReadAttribute("attribute-list") + ReadThermostatAlarmMask() + : ReadAttribute("alarm-mask") { } - ~ReadTestClusterAttributeList() {} + ~ReadThermostatAlarmMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.AttributeList response %@", [value description]); + [cluster readAttributeAlarmMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AlarmMask response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster AttributeList read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AlarmMask read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -64175,34 +86789,34 @@ class ReadTestClusterAttributeList : public ReadAttribute { } }; -class SubscribeAttributeTestClusterAttributeList : public SubscribeAttribute { +class SubscribeAttributeThermostatAlarmMask : public SubscribeAttribute { public: - SubscribeAttributeTestClusterAttributeList() - : SubscribeAttribute("attribute-list") + SubscribeAttributeThermostatAlarmMask() + : SubscribeAttribute("alarm-mask") { } - ~SubscribeAttributeTestClusterAttributeList() {} + ~SubscribeAttributeThermostatAlarmMask() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001D) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.AttributeList response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAlarmMaskWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AlarmMask response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64214,30 +86828,30 @@ class SubscribeAttributeTestClusterAttributeList : public SubscribeAttribute { }; /* - * Attribute ClusterRevision + * Attribute ThermostatRunningMode */ -class ReadTestClusterClusterRevision : public ReadAttribute { +class ReadThermostatThermostatRunningMode : public ReadAttribute { public: - ReadTestClusterClusterRevision() - : ReadAttribute("cluster-revision") + ReadThermostatThermostatRunningMode() + : ReadAttribute("thermostat-running-mode") { } - ~ReadTestClusterClusterRevision() {} + ~ReadThermostatThermostatRunningMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ClusterRevision response %@", [value description]); + [cluster readAttributeThermostatRunningModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ThermostatRunningMode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "TestCluster ClusterRevision read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat ThermostatRunningMode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -64245,34 +86859,35 @@ class ReadTestClusterClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeTestClusterClusterRevision : public SubscribeAttribute { +class SubscribeAttributeThermostatThermostatRunningMode : public SubscribeAttribute { public: - SubscribeAttributeTestClusterClusterRevision() - : SubscribeAttribute("cluster-revision") + SubscribeAttributeThermostatThermostatRunningMode() + : SubscribeAttribute("thermostat-running-mode") { } - ~SubscribeAttributeTestClusterClusterRevision() {} + ~SubscribeAttributeThermostatThermostatRunningMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001E) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"TestCluster.ClusterRevision response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeThermostatRunningModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ThermostatRunningMode response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64283,380 +86898,212 @@ class SubscribeAttributeTestClusterClusterRevision : public SubscribeAttribute { } }; -/*----------------------------------------------------------------------------*\ -| Cluster Thermostat | 0x0201 | -|------------------------------------------------------------------------------| -| Commands: | | -| * SetpointRaiseLower | 0x00 | -| * SetWeeklySchedule | 0x01 | -| * GetWeeklySchedule | 0x02 | -| * ClearWeeklySchedule | 0x03 | -| * GetRelayStatusLog | 0x04 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * LocalTemperature | 0x0000 | -| * OutdoorTemperature | 0x0001 | -| * Occupancy | 0x0002 | -| * AbsMinHeatSetpointLimit | 0x0003 | -| * AbsMaxHeatSetpointLimit | 0x0004 | -| * AbsMinCoolSetpointLimit | 0x0005 | -| * AbsMaxCoolSetpointLimit | 0x0006 | -| * PiCoolingDemand | 0x0007 | -| * PiHeatingDemand | 0x0008 | -| * HvacSystemTypeConfiguration | 0x0009 | -| * LocalTemperatureCalibration | 0x0010 | -| * OccupiedCoolingSetpoint | 0x0011 | -| * OccupiedHeatingSetpoint | 0x0012 | -| * UnoccupiedCoolingSetpoint | 0x0013 | -| * UnoccupiedHeatingSetpoint | 0x0014 | -| * MinHeatSetpointLimit | 0x0015 | -| * MaxHeatSetpointLimit | 0x0016 | -| * MinCoolSetpointLimit | 0x0017 | -| * MaxCoolSetpointLimit | 0x0018 | -| * MinSetpointDeadBand | 0x0019 | -| * RemoteSensing | 0x001A | -| * ControlSequenceOfOperation | 0x001B | -| * SystemMode | 0x001C | -| * AlarmMask | 0x001D | -| * ThermostatRunningMode | 0x001E | -| * StartOfWeek | 0x0020 | -| * NumberOfWeeklyTransitions | 0x0021 | -| * NumberOfDailyTransitions | 0x0022 | -| * TemperatureSetpointHold | 0x0023 | -| * TemperatureSetpointHoldDuration | 0x0024 | -| * ThermostatProgrammingOperationMode | 0x0025 | -| * ThermostatRunningState | 0x0029 | -| * SetpointChangeSource | 0x0030 | -| * SetpointChangeAmount | 0x0031 | -| * SetpointChangeSourceTimestamp | 0x0032 | -| * AcType | 0x0040 | -| * AcCapacity | 0x0041 | -| * AcRefrigerantType | 0x0042 | -| * AcCompressorType | 0x0043 | -| * AcErrorCode | 0x0044 | -| * AcLouverPosition | 0x0045 | -| * AcCoilTemperature | 0x0046 | -| * AcCapacityFormat | 0x0047 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* - * Command ClearWeeklySchedule + * Attribute StartOfWeek */ -class ThermostatClearWeeklySchedule : public ClusterCommand { +class ReadThermostatStartOfWeek : public ReadAttribute { public: - ThermostatClearWeeklySchedule() - : ClusterCommand("clear-weekly-schedule") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + ReadThermostatStartOfWeek() + : ReadAttribute("start-of-week") { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000003) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPThermostatClusterClearWeeklyScheduleParams 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 clearWeeklyScheduleWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; } -private: -}; - -/* - * Command GetRelayStatusLog - */ -class ThermostatGetRelayStatusLog : public ClusterCommand { -public: - ThermostatGetRelayStatusLog() - : ClusterCommand("get-relay-status-log") - { - ClusterCommand::AddArguments(); - } + ~ReadThermostatStartOfWeek() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPThermostatClusterGetRelayStatusLogParams 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 getRelayStatusLogWithCompletionHandler:^( - CHIPThermostatClusterGetRelayStatusLogResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.StartOfWeek response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: + if (error != nil) { + ChipLogError(chipTool, "Thermostat StartOfWeek read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command GetWeeklySchedule - */ -class ThermostatGetWeeklySchedule : public ClusterCommand { +class SubscribeAttributeThermostatStartOfWeek : public SubscribeAttribute { public: - ThermostatGetWeeklySchedule() - : ClusterCommand("get-weekly-schedule") + SubscribeAttributeThermostatStartOfWeek() + : SubscribeAttribute("start-of-week") { - AddArgument("DaysToReturn", 0, UINT8_MAX, &mDaysToReturn); - AddArgument("ModeToReturn", 0, UINT8_MAX, &mModeToReturn); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeThermostatStartOfWeek() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000002) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000020) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPThermostatClusterGetWeeklyScheduleParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.daysToReturn = [NSNumber numberWithUnsignedChar:mDaysToReturn]; - params.modeToReturn = [NSNumber numberWithUnsignedChar:mModeToReturn]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster getWeeklyScheduleWithParams:params - completionHandler:^(CHIPThermostatClusterGetWeeklyScheduleResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeStartOfWeekWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.StartOfWeek response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - uint8_t mDaysToReturn; - uint8_t mModeToReturn; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Command SetWeeklySchedule + * Attribute NumberOfWeeklyTransitions */ -class ThermostatSetWeeklySchedule : public ClusterCommand { +class ReadThermostatNumberOfWeeklyTransitions : public ReadAttribute { public: - ThermostatSetWeeklySchedule() - : ClusterCommand("set-weekly-schedule") - , mComplex_Payload(&mRequest.payload) + ReadThermostatNumberOfWeeklyTransitions() + : ReadAttribute("number-of-weekly-transitions") { - AddArgument("NumberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence); - AddArgument("DayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence); - AddArgument("ModeForSequence", 0, UINT8_MAX, &mModeForSequence); - AddArgument("Payload", &mComplex_Payload); - ClusterCommand::AddArguments(); } + ~ReadThermostatNumberOfWeeklyTransitions() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000001) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPThermostatClusterSetWeeklyScheduleParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.numberOfTransitionsForSequence = [NSNumber numberWithUnsignedChar:mNumberOfTransitionsForSequence]; - params.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:mDayOfWeekForSequence]; - params.modeForSequence = [NSNumber numberWithUnsignedChar:mModeForSequence]; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - for (auto & entry_0 : mRequest.payload) { - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - params.payload = array_0; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster setWeeklyScheduleWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; - } + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; -private: - uint8_t mNumberOfTransitionsForSequence; - uint8_t mDayOfWeekForSequence; - uint8_t mModeForSequence; - chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type mRequest; - TypedComplexArgument> mComplex_Payload; + if (error != nil) { + ChipLogError(chipTool, "Thermostat NumberOfWeeklyTransitions read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } }; -/* - * Command SetpointRaiseLower - */ -class ThermostatSetpointRaiseLower : public ClusterCommand { +class SubscribeAttributeThermostatNumberOfWeeklyTransitions : public SubscribeAttribute { public: - ThermostatSetpointRaiseLower() - : ClusterCommand("setpoint-raise-lower") + SubscribeAttributeThermostatNumberOfWeeklyTransitions() + : SubscribeAttribute("number-of-weekly-transitions") { - AddArgument("Mode", 0, UINT8_MAX, &mMode); - AddArgument("Amount", INT8_MIN, INT8_MAX, &mAmount); - ClusterCommand::AddArguments(); } + ~SubscribeAttributeThermostatNumberOfWeeklyTransitions() {} + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000000) on endpoint %u", endpointId); - + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000021) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPThermostatClusterSetpointRaiseLowerParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.mode = [NSNumber numberWithUnsignedChar:mMode]; - params.amount = [NSNumber numberWithChar:mAmount]; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster setpointRaiseLowerWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return chipError; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeNumberOfWeeklyTransitionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; } -private: - uint8_t mMode; - int8_t mAmount; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } }; /* - * Attribute LocalTemperature + * Attribute NumberOfDailyTransitions */ -class ReadThermostatLocalTemperature : public ReadAttribute { +class ReadThermostatNumberOfDailyTransitions : public ReadAttribute { public: - ReadThermostatLocalTemperature() - : ReadAttribute("local-temperature") + ReadThermostatNumberOfDailyTransitions() + : ReadAttribute("number-of-daily-transitions") { } - ~ReadThermostatLocalTemperature() {} + ~ReadThermostatNumberOfDailyTransitions() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.LocalTemperature response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfDailyTransitions response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat LocalTemperature read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat NumberOfDailyTransitions read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeThermostatLocalTemperature : public SubscribeAttribute { +class SubscribeAttributeThermostatNumberOfDailyTransitions : public SubscribeAttribute { public: - SubscribeAttributeThermostatLocalTemperature() - : SubscribeAttribute("local-temperature") + SubscribeAttributeThermostatNumberOfDailyTransitions() + : SubscribeAttribute("number-of-daily-transitions") { } - ~SubscribeAttributeThermostatLocalTemperature() {} + ~SubscribeAttributeThermostatNumberOfDailyTransitions() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000000) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000022) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeLocalTemperatureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.LocalTemperature response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeNumberOfDailyTransitionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfDailyTransitions response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64668,31 +87115,31 @@ class SubscribeAttributeThermostatLocalTemperature : public SubscribeAttribute { }; /* - * Attribute AbsMinHeatSetpointLimit + * Attribute TemperatureSetpointHold */ -class ReadThermostatAbsMinHeatSetpointLimit : public ReadAttribute { +class ReadThermostatTemperatureSetpointHold : public ReadAttribute { public: - ReadThermostatAbsMinHeatSetpointLimit() - : ReadAttribute("abs-min-heat-setpoint-limit") + ReadThermostatTemperatureSetpointHold() + : ReadAttribute("temperature-setpoint-hold") { } - ~ReadThermostatAbsMinHeatSetpointLimit() {} + ~ReadThermostatTemperatureSetpointHold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; [cluster - readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", [value description]); + readAttributeTemperatureSetpointHoldWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.TemperatureSetpointHold response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat AbsMinHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat TemperatureSetpointHold read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -64700,30 +87147,70 @@ class ReadThermostatAbsMinHeatSetpointLimit : public ReadAttribute { } }; -class SubscribeAttributeThermostatAbsMinHeatSetpointLimit : public SubscribeAttribute { +class WriteThermostatTemperatureSetpointHold : public WriteAttribute { public: - SubscribeAttributeThermostatAbsMinHeatSetpointLimit() - : SubscribeAttribute("abs-min-heat-setpoint-limit") + WriteThermostatTemperatureSetpointHold() + : WriteAttribute("temperature-setpoint-hold") { + AddArgument("attr-name", "temperature-setpoint-hold"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeThermostatAbsMinHeatSetpointLimit() {} + ~WriteThermostatTemperatureSetpointHold() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000003) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000023) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeTemperatureSetpointHoldWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat TemperatureSetpointHold write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeThermostatTemperatureSetpointHold : public SubscribeAttribute { +public: + SubscribeAttributeThermostatTemperatureSetpointHold() + : SubscribeAttribute("temperature-setpoint-hold") + { + } + + ~SubscribeAttributeThermostatTemperatureSetpointHold() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000023) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAbsMinHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + [cluster subscribeAttributeTemperatureSetpointHoldWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] params:params subscriptionEstablished:nullptr reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", + NSLog(@"Thermostat.TemperatureSetpointHold response %@", [value description]); if (error || !mWait) { SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); @@ -64740,67 +87227,110 @@ class SubscribeAttributeThermostatAbsMinHeatSetpointLimit : public SubscribeAttr }; /* - * Attribute AbsMaxHeatSetpointLimit + * Attribute TemperatureSetpointHoldDuration */ -class ReadThermostatAbsMaxHeatSetpointLimit : public ReadAttribute { +class ReadThermostatTemperatureSetpointHoldDuration : public ReadAttribute { public: - ReadThermostatAbsMaxHeatSetpointLimit() - : ReadAttribute("abs-max-heat-setpoint-limit") + ReadThermostatTemperatureSetpointHoldDuration() + : ReadAttribute("temperature-setpoint-hold-duration") { } - ~ReadThermostatAbsMaxHeatSetpointLimit() {} + ~ReadThermostatTemperatureSetpointHoldDuration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeTemperatureSetpointHoldDurationWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.TemperatureSetpointHoldDuration response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat AbsMaxHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat TemperatureSetpointHoldDuration read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeThermostatAbsMaxHeatSetpointLimit : public SubscribeAttribute { +class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { public: - SubscribeAttributeThermostatAbsMaxHeatSetpointLimit() - : SubscribeAttribute("abs-max-heat-setpoint-limit") + WriteThermostatTemperatureSetpointHoldDuration() + : WriteAttribute("temperature-setpoint-hold-duration") { + AddArgument("attr-name", "temperature-setpoint-hold-duration"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeThermostatAbsMaxHeatSetpointLimit() {} + ~WriteThermostatTemperatureSetpointHoldDuration() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000004) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000024) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + + [cluster writeAttributeTemperatureSetpointHoldDurationWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "Thermostat TemperatureSetpointHoldDuration write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint16_t mValue; +}; + +class SubscribeAttributeThermostatTemperatureSetpointHoldDuration : public SubscribeAttribute { +public: + SubscribeAttributeThermostatTemperatureSetpointHoldDuration() + : SubscribeAttribute("temperature-setpoint-hold-duration") + { + } + + ~SubscribeAttributeThermostatTemperatureSetpointHoldDuration() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000024) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAbsMaxHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeTemperatureSetpointHoldDurationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.TemperatureSetpointHoldDuration response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64812,67 +87342,183 @@ class SubscribeAttributeThermostatAbsMaxHeatSetpointLimit : public SubscribeAttr }; /* - * Attribute AbsMinCoolSetpointLimit + * Attribute ThermostatProgrammingOperationMode */ -class ReadThermostatAbsMinCoolSetpointLimit : public ReadAttribute { +class ReadThermostatThermostatProgrammingOperationMode : public ReadAttribute { public: - ReadThermostatAbsMinCoolSetpointLimit() - : ReadAttribute("abs-min-cool-setpoint-limit") + ReadThermostatThermostatProgrammingOperationMode() + : ReadAttribute("thermostat-programming-operation-mode") { } - ~ReadThermostatAbsMinCoolSetpointLimit() {} + ~ReadThermostatThermostatProgrammingOperationMode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000025) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeThermostatProgrammingOperationModeWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ThermostatProgrammingOperationMode response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Thermostat ThermostatProgrammingOperationMode read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class WriteThermostatThermostatProgrammingOperationMode : public WriteAttribute { +public: + WriteThermostatThermostatProgrammingOperationMode() + : WriteAttribute("thermostat-programming-operation-mode") + { + AddArgument("attr-name", "thermostat-programming-operation-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteThermostatThermostatProgrammingOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000025) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + [cluster - readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + writeAttributeThermostatProgrammingOperationModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, + "Thermostat ThermostatProgrammingOperationMode write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } - if (error != nil) { - ChipLogError(chipTool, "Thermostat AbsMinCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; +private: + uint8_t mValue; +}; + +class SubscribeAttributeThermostatThermostatProgrammingOperationMode : public SubscribeAttribute { +public: + SubscribeAttributeThermostatThermostatProgrammingOperationMode() + : SubscribeAttribute("thermostat-programming-operation-mode") + { + } + + ~SubscribeAttributeThermostatThermostatProgrammingOperationMode() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000025) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeThermostatProgrammingOperationModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ThermostatProgrammingOperationMode " + @"response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus( + [CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ThermostatRunningState + */ +class ReadThermostatThermostatRunningState : public ReadAttribute { +public: + ReadThermostatThermostatRunningState() + : ReadAttribute("thermostat-running-state") + { + } + + ~ReadThermostatThermostatRunningState() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000029) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeThermostatRunningStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ThermostatRunningState response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "Thermostat ThermostatRunningState read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeThermostatAbsMinCoolSetpointLimit : public SubscribeAttribute { +class SubscribeAttributeThermostatThermostatRunningState : public SubscribeAttribute { public: - SubscribeAttributeThermostatAbsMinCoolSetpointLimit() - : SubscribeAttribute("abs-min-cool-setpoint-limit") + SubscribeAttributeThermostatThermostatRunningState() + : SubscribeAttribute("thermostat-running-state") { } - ~SubscribeAttributeThermostatAbsMinCoolSetpointLimit() {} + ~SubscribeAttributeThermostatThermostatRunningState() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000029) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAbsMinCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeThermostatRunningStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ThermostatRunningState response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64884,67 +87530,66 @@ class SubscribeAttributeThermostatAbsMinCoolSetpointLimit : public SubscribeAttr }; /* - * Attribute AbsMaxCoolSetpointLimit + * Attribute SetpointChangeSource */ -class ReadThermostatAbsMaxCoolSetpointLimit : public ReadAttribute { +class ReadThermostatSetpointChangeSource : public ReadAttribute { public: - ReadThermostatAbsMaxCoolSetpointLimit() - : ReadAttribute("abs-max-cool-setpoint-limit") + ReadThermostatSetpointChangeSource() + : ReadAttribute("setpoint-change-source") { } - ~ReadThermostatAbsMaxCoolSetpointLimit() {} + ~ReadThermostatSetpointChangeSource() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeSetpointChangeSourceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointChangeSource response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat AbsMaxCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat SetpointChangeSource read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeThermostatAbsMaxCoolSetpointLimit : public SubscribeAttribute { +class SubscribeAttributeThermostatSetpointChangeSource : public SubscribeAttribute { public: - SubscribeAttributeThermostatAbsMaxCoolSetpointLimit() - : SubscribeAttribute("abs-max-cool-setpoint-limit") + SubscribeAttributeThermostatSetpointChangeSource() + : SubscribeAttribute("setpoint-change-source") { } - ~SubscribeAttributeThermostatAbsMaxCoolSetpointLimit() {} + ~SubscribeAttributeThermostatSetpointChangeSource() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000006) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000030) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeAbsMaxCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeSetpointChangeSourceWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointChangeSource response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -64956,107 +87601,66 @@ class SubscribeAttributeThermostatAbsMaxCoolSetpointLimit : public SubscribeAttr }; /* - * Attribute OccupiedCoolingSetpoint + * Attribute SetpointChangeAmount */ -class ReadThermostatOccupiedCoolingSetpoint : public ReadAttribute { +class ReadThermostatSetpointChangeAmount : public ReadAttribute { public: - ReadThermostatOccupiedCoolingSetpoint() - : ReadAttribute("occupied-cooling-setpoint") + ReadThermostatSetpointChangeAmount() + : ReadAttribute("setpoint-change-amount") { } - ~ReadThermostatOccupiedCoolingSetpoint() {} + ~ReadThermostatSetpointChangeAmount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeSetpointChangeAmountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointChangeAmount response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat OccupiedCoolingSetpoint read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat SetpointChangeAmount read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteThermostatOccupiedCoolingSetpoint : public WriteAttribute { -public: - WriteThermostatOccupiedCoolingSetpoint() - : WriteAttribute("occupied-cooling-setpoint") - { - AddArgument("attr-name", "occupied-cooling-setpoint"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteThermostatOccupiedCoolingSetpoint() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000011) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - - [cluster writeAttributeOccupiedCoolingSetpointWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat OccupiedCoolingSetpoint write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int16_t mValue; -}; - -class SubscribeAttributeThermostatOccupiedCoolingSetpoint : public SubscribeAttribute { +class SubscribeAttributeThermostatSetpointChangeAmount : public SubscribeAttribute { public: - SubscribeAttributeThermostatOccupiedCoolingSetpoint() - : SubscribeAttribute("occupied-cooling-setpoint") + SubscribeAttributeThermostatSetpointChangeAmount() + : SubscribeAttribute("setpoint-change-amount") { } - ~SubscribeAttributeThermostatOccupiedCoolingSetpoint() {} + ~SubscribeAttributeThermostatSetpointChangeAmount() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000011) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000031) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOccupiedCoolingSetpointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeSetpointChangeAmountWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointChangeAmount response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65068,107 +87672,69 @@ class SubscribeAttributeThermostatOccupiedCoolingSetpoint : public SubscribeAttr }; /* - * Attribute OccupiedHeatingSetpoint + * Attribute SetpointChangeSourceTimestamp */ -class ReadThermostatOccupiedHeatingSetpoint : public ReadAttribute { +class ReadThermostatSetpointChangeSourceTimestamp : public ReadAttribute { public: - ReadThermostatOccupiedHeatingSetpoint() - : ReadAttribute("occupied-heating-setpoint") + ReadThermostatSetpointChangeSourceTimestamp() + : ReadAttribute("setpoint-change-source-timestamp") { } - ~ReadThermostatOccupiedHeatingSetpoint() {} + ~ReadThermostatSetpointChangeSourceTimestamp() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeSetpointChangeSourceTimestampWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointChangeSourceTimestamp response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat OccupiedHeatingSetpoint read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat SetpointChangeSourceTimestamp read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteThermostatOccupiedHeatingSetpoint : public WriteAttribute { -public: - WriteThermostatOccupiedHeatingSetpoint() - : WriteAttribute("occupied-heating-setpoint") - { - AddArgument("attr-name", "occupied-heating-setpoint"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteThermostatOccupiedHeatingSetpoint() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000012) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - - [cluster writeAttributeOccupiedHeatingSetpointWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat OccupiedHeatingSetpoint write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - int16_t mValue; -}; - -class SubscribeAttributeThermostatOccupiedHeatingSetpoint : public SubscribeAttribute { +class SubscribeAttributeThermostatSetpointChangeSourceTimestamp : public SubscribeAttribute { public: - SubscribeAttributeThermostatOccupiedHeatingSetpoint() - : SubscribeAttribute("occupied-heating-setpoint") + SubscribeAttributeThermostatSetpointChangeSourceTimestamp() + : SubscribeAttribute("setpoint-change-source-timestamp") { } - ~SubscribeAttributeThermostatOccupiedHeatingSetpoint() {} + ~SubscribeAttributeThermostatSetpointChangeSourceTimestamp() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000032) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeOccupiedHeatingSetpointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster + subscribeAttributeSetpointChangeSourceTimestampWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointChangeSourceTimestamp response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65180,30 +87746,30 @@ class SubscribeAttributeThermostatOccupiedHeatingSetpoint : public SubscribeAttr }; /* - * Attribute MinHeatSetpointLimit + * Attribute AcType */ -class ReadThermostatMinHeatSetpointLimit : public ReadAttribute { +class ReadThermostatAcType : public ReadAttribute { public: - ReadThermostatMinHeatSetpointLimit() - : ReadAttribute("min-heat-setpoint-limit") + ReadThermostatAcType() + : ReadAttribute("ac-type") { } - ~ReadThermostatMinHeatSetpointLimit() {} + ~ReadThermostatAcType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); + [cluster readAttributeAcTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat MinHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65211,75 +87777,73 @@ class ReadThermostatMinHeatSetpointLimit : public ReadAttribute { } }; -class WriteThermostatMinHeatSetpointLimit : public WriteAttribute { +class WriteThermostatAcType : public WriteAttribute { public: - WriteThermostatMinHeatSetpointLimit() - : WriteAttribute("min-heat-setpoint-limit") + WriteThermostatAcType() + : WriteAttribute("ac-type") { - AddArgument("attr-name", "min-heat-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "ac-type"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatMinHeatSetpointLimit() {} + ~WriteThermostatAcType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeMinHeatSetpointLimitWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat MinHeatSetpointLimit write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeAcTypeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcType write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + uint8_t mValue; }; -class SubscribeAttributeThermostatMinHeatSetpointLimit : public SubscribeAttribute { +class SubscribeAttributeThermostatAcType : public SubscribeAttribute { public: - SubscribeAttributeThermostatMinHeatSetpointLimit() - : SubscribeAttribute("min-heat-setpoint-limit") + SubscribeAttributeThermostatAcType() + : SubscribeAttribute("ac-type") { } - ~SubscribeAttributeThermostatMinHeatSetpointLimit() {} + ~SubscribeAttributeThermostatAcType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000015) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000040) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMinHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65291,30 +87855,30 @@ class SubscribeAttributeThermostatMinHeatSetpointLimit : public SubscribeAttribu }; /* - * Attribute MaxHeatSetpointLimit + * Attribute AcCapacity */ -class ReadThermostatMaxHeatSetpointLimit : public ReadAttribute { +class ReadThermostatAcCapacity : public ReadAttribute { public: - ReadThermostatMaxHeatSetpointLimit() - : ReadAttribute("max-heat-setpoint-limit") + ReadThermostatAcCapacity() + : ReadAttribute("ac-capacity") { } - ~ReadThermostatMaxHeatSetpointLimit() {} + ~ReadThermostatAcCapacity() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); + [cluster readAttributeAcCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCapacity response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat MaxHeatSetpointLimit read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcCapacity read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65322,75 +87886,73 @@ class ReadThermostatMaxHeatSetpointLimit : public ReadAttribute { } }; -class WriteThermostatMaxHeatSetpointLimit : public WriteAttribute { +class WriteThermostatAcCapacity : public WriteAttribute { public: - WriteThermostatMaxHeatSetpointLimit() - : WriteAttribute("max-heat-setpoint-limit") + WriteThermostatAcCapacity() + : WriteAttribute("ac-capacity") { - AddArgument("attr-name", "max-heat-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "ac-capacity"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatMaxHeatSetpointLimit() {} + ~WriteThermostatAcCapacity() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeMaxHeatSetpointLimitWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat MaxHeatSetpointLimit write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeAcCapacityWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcCapacity write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + uint16_t mValue; }; -class SubscribeAttributeThermostatMaxHeatSetpointLimit : public SubscribeAttribute { +class SubscribeAttributeThermostatAcCapacity : public SubscribeAttribute { public: - SubscribeAttributeThermostatMaxHeatSetpointLimit() - : SubscribeAttribute("max-heat-setpoint-limit") + SubscribeAttributeThermostatAcCapacity() + : SubscribeAttribute("ac-capacity") { } - ~SubscribeAttributeThermostatMaxHeatSetpointLimit() {} + ~SubscribeAttributeThermostatAcCapacity() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000016) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000041) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMaxHeatSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcCapacityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCapacity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65402,30 +87964,30 @@ class SubscribeAttributeThermostatMaxHeatSetpointLimit : public SubscribeAttribu }; /* - * Attribute MinCoolSetpointLimit + * Attribute AcRefrigerantType */ -class ReadThermostatMinCoolSetpointLimit : public ReadAttribute { +class ReadThermostatAcRefrigerantType : public ReadAttribute { public: - ReadThermostatMinCoolSetpointLimit() - : ReadAttribute("min-cool-setpoint-limit") + ReadThermostatAcRefrigerantType() + : ReadAttribute("ac-refrigerant-type") { } - ~ReadThermostatMinCoolSetpointLimit() {} + ~ReadThermostatAcRefrigerantType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); + [cluster readAttributeAcRefrigerantTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcRefrigerantType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat MinCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcRefrigerantType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65433,75 +87995,74 @@ class ReadThermostatMinCoolSetpointLimit : public ReadAttribute { } }; -class WriteThermostatMinCoolSetpointLimit : public WriteAttribute { +class WriteThermostatAcRefrigerantType : public WriteAttribute { public: - WriteThermostatMinCoolSetpointLimit() - : WriteAttribute("min-cool-setpoint-limit") + WriteThermostatAcRefrigerantType() + : WriteAttribute("ac-refrigerant-type") { - AddArgument("attr-name", "min-cool-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "ac-refrigerant-type"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatMinCoolSetpointLimit() {} + ~WriteThermostatAcRefrigerantType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeMinCoolSetpointLimitWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat MinCoolSetpointLimit write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeAcRefrigerantTypeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcRefrigerantType write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + uint8_t mValue; }; -class SubscribeAttributeThermostatMinCoolSetpointLimit : public SubscribeAttribute { +class SubscribeAttributeThermostatAcRefrigerantType : public SubscribeAttribute { public: - SubscribeAttributeThermostatMinCoolSetpointLimit() - : SubscribeAttribute("min-cool-setpoint-limit") + SubscribeAttributeThermostatAcRefrigerantType() + : SubscribeAttribute("ac-refrigerant-type") { } - ~SubscribeAttributeThermostatMinCoolSetpointLimit() {} + ~SubscribeAttributeThermostatAcRefrigerantType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000017) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000042) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMinCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcRefrigerantTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcRefrigerantType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65513,30 +88074,30 @@ class SubscribeAttributeThermostatMinCoolSetpointLimit : public SubscribeAttribu }; /* - * Attribute MaxCoolSetpointLimit + * Attribute AcCompressorType */ -class ReadThermostatMaxCoolSetpointLimit : public ReadAttribute { +class ReadThermostatAcCompressorType : public ReadAttribute { public: - ReadThermostatMaxCoolSetpointLimit() - : ReadAttribute("max-cool-setpoint-limit") + ReadThermostatAcCompressorType() + : ReadAttribute("ac-compressor-type") { } - ~ReadThermostatMaxCoolSetpointLimit() {} + ~ReadThermostatAcCompressorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000043) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); + [cluster readAttributeAcCompressorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCompressorType response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat MaxCoolSetpointLimit read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcCompressorType read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65544,75 +88105,74 @@ class ReadThermostatMaxCoolSetpointLimit : public ReadAttribute { } }; -class WriteThermostatMaxCoolSetpointLimit : public WriteAttribute { +class WriteThermostatAcCompressorType : public WriteAttribute { public: - WriteThermostatMaxCoolSetpointLimit() - : WriteAttribute("max-cool-setpoint-limit") + WriteThermostatAcCompressorType() + : WriteAttribute("ac-compressor-type") { - AddArgument("attr-name", "max-cool-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "ac-compressor-type"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatMaxCoolSetpointLimit() {} + ~WriteThermostatAcCompressorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000043) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeMaxCoolSetpointLimitWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat MaxCoolSetpointLimit write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeAcCompressorTypeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcCompressorType write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int16_t mValue; + uint8_t mValue; }; -class SubscribeAttributeThermostatMaxCoolSetpointLimit : public SubscribeAttribute { +class SubscribeAttributeThermostatAcCompressorType : public SubscribeAttribute { public: - SubscribeAttributeThermostatMaxCoolSetpointLimit() - : SubscribeAttribute("max-cool-setpoint-limit") + SubscribeAttributeThermostatAcCompressorType() + : SubscribeAttribute("ac-compressor-type") { } - ~SubscribeAttributeThermostatMaxCoolSetpointLimit() {} + ~SubscribeAttributeThermostatAcCompressorType() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000018) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000043) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMaxCoolSetpointLimitWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcCompressorTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCompressorType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65624,30 +88184,30 @@ class SubscribeAttributeThermostatMaxCoolSetpointLimit : public SubscribeAttribu }; /* - * Attribute MinSetpointDeadBand + * Attribute AcErrorCode */ -class ReadThermostatMinSetpointDeadBand : public ReadAttribute { +class ReadThermostatAcErrorCode : public ReadAttribute { public: - ReadThermostatMinSetpointDeadBand() - : ReadAttribute("min-setpoint-dead-band") + ReadThermostatAcErrorCode() + : ReadAttribute("ac-error-code") { } - ~ReadThermostatMinSetpointDeadBand() {} + ~ReadThermostatAcErrorCode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000044) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); + [cluster readAttributeAcErrorCodeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcErrorCode response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat MinSetpointDeadBand read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcErrorCode read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65655,75 +88215,74 @@ class ReadThermostatMinSetpointDeadBand : public ReadAttribute { } }; -class WriteThermostatMinSetpointDeadBand : public WriteAttribute { +class WriteThermostatAcErrorCode : public WriteAttribute { public: - WriteThermostatMinSetpointDeadBand() - : WriteAttribute("min-setpoint-dead-band") + WriteThermostatAcErrorCode() + : WriteAttribute("ac-error-code") { - AddArgument("attr-name", "min-setpoint-dead-band"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + AddArgument("attr-name", "ac-error-code"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatMinSetpointDeadBand() {} + ~WriteThermostatAcErrorCode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000044) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; params.timedWriteTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; - [cluster writeAttributeMinSetpointDeadBandWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat MinSetpointDeadBand write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster + writeAttributeAcErrorCodeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcErrorCode write Error: %s", chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } private: - int8_t mValue; + uint32_t mValue; }; -class SubscribeAttributeThermostatMinSetpointDeadBand : public SubscribeAttribute { +class SubscribeAttributeThermostatAcErrorCode : public SubscribeAttribute { public: - SubscribeAttributeThermostatMinSetpointDeadBand() - : SubscribeAttribute("min-setpoint-dead-band") + SubscribeAttributeThermostatAcErrorCode() + : SubscribeAttribute("ac-error-code") { } - ~SubscribeAttributeThermostatMinSetpointDeadBand() {} + ~SubscribeAttributeThermostatAcErrorCode() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000019) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000044) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeMinSetpointDeadBandWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcErrorCodeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcErrorCode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65735,53 +88294,52 @@ class SubscribeAttributeThermostatMinSetpointDeadBand : public SubscribeAttribut }; /* - * Attribute ControlSequenceOfOperation + * Attribute AcLouverPosition */ -class ReadThermostatControlSequenceOfOperation : public ReadAttribute { +class ReadThermostatAcLouverPosition : public ReadAttribute { public: - ReadThermostatControlSequenceOfOperation() - : ReadAttribute("control-sequence-of-operation") + ReadThermostatAcLouverPosition() + : ReadAttribute("ac-louver-position") { } - ~ReadThermostatControlSequenceOfOperation() {} + ~ReadThermostatAcLouverPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000045) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.ControlSequenceOfOperation response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeAcLouverPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcLouverPosition response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat ControlSequenceOfOperation read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcLouverPosition read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class WriteThermostatControlSequenceOfOperation : public WriteAttribute { +class WriteThermostatAcLouverPosition : public WriteAttribute { public: - WriteThermostatControlSequenceOfOperation() - : WriteAttribute("control-sequence-of-operation") + WriteThermostatAcLouverPosition() + : WriteAttribute("ac-louver-position") { - AddArgument("attr-name", "control-sequence-of-operation"); + AddArgument("attr-name", "ac-louver-position"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatControlSequenceOfOperation() {} + ~WriteThermostatAcLouverPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000045) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; @@ -65790,17 +88348,16 @@ class WriteThermostatControlSequenceOfOperation : public WriteAttribute { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeControlSequenceOfOperationWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat ControlSequenceOfOperation write Error: %s", - chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; + [cluster writeAttributeAcLouverPositionWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcLouverPosition write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; return chipError; } @@ -65808,36 +88365,34 @@ class WriteThermostatControlSequenceOfOperation : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeThermostatControlSequenceOfOperation : public SubscribeAttribute { +class SubscribeAttributeThermostatAcLouverPosition : public SubscribeAttribute { public: - SubscribeAttributeThermostatControlSequenceOfOperation() - : SubscribeAttribute("control-sequence-of-operation") + SubscribeAttributeThermostatAcLouverPosition() + : SubscribeAttribute("ac-louver-position") { } - ~SubscribeAttributeThermostatControlSequenceOfOperation() {} + ~SubscribeAttributeThermostatAcLouverPosition() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001B) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000045) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeControlSequenceOfOperationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.ControlSequenceOfOperation response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcLouverPositionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcLouverPosition response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65849,30 +88404,30 @@ class SubscribeAttributeThermostatControlSequenceOfOperation : public SubscribeA }; /* - * Attribute SystemMode + * Attribute AcCoilTemperature */ -class ReadThermostatSystemMode : public ReadAttribute { +class ReadThermostatAcCoilTemperature : public ReadAttribute { public: - ReadThermostatSystemMode() - : ReadAttribute("system-mode") + ReadThermostatAcCoilTemperature() + : ReadAttribute("ac-coil-temperature") { } - ~ReadThermostatSystemMode() {} + ~ReadThermostatAcCoilTemperature() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000046) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.SystemMode response %@", [value description]); + [cluster readAttributeAcCoilTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCoilTemperature response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat SystemMode read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcCoilTemperature read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65880,73 +88435,34 @@ class ReadThermostatSystemMode : public ReadAttribute { } }; -class WriteThermostatSystemMode : public WriteAttribute { -public: - WriteThermostatSystemMode() - : WriteAttribute("system-mode") - { - AddArgument("attr-name", "system-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteThermostatSystemMode() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001C) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; - params.timedWriteTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - - [cluster writeAttributeSystemModeWithValue:value - params:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat SystemMode write Error: %s", chip::ErrorStr(chipError)); - } - SetCommandExitStatus(chipError); - }]; - return chipError; - } - -private: - uint8_t mValue; -}; - -class SubscribeAttributeThermostatSystemMode : public SubscribeAttribute { +class SubscribeAttributeThermostatAcCoilTemperature : public SubscribeAttribute { public: - SubscribeAttributeThermostatSystemMode() - : SubscribeAttribute("system-mode") + SubscribeAttributeThermostatAcCoilTemperature() + : SubscribeAttribute("ac-coil-temperature") { } - ~SubscribeAttributeThermostatSystemMode() {} + ~SubscribeAttributeThermostatAcCoilTemperature() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001C) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000046) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeSystemModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.SystemMode response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcCoilTemperatureWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCoilTemperature response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -65958,30 +88474,30 @@ class SubscribeAttributeThermostatSystemMode : public SubscribeAttribute { }; /* - * Attribute StartOfWeek + * Attribute AcCapacityFormat */ -class ReadThermostatStartOfWeek : public ReadAttribute { +class ReadThermostatAcCapacityFormat : public ReadAttribute { public: - ReadThermostatStartOfWeek() - : ReadAttribute("start-of-week") + ReadThermostatAcCapacityFormat() + : ReadAttribute("ac-capacity-format") { } - ~ReadThermostatStartOfWeek() {} + ~ReadThermostatAcCapacityFormat() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000047) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.StartOfWeek response %@", [value description]); + [cluster readAttributeAcCapacityFormatWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCapacityFormat response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "Thermostat StartOfWeek read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "Thermostat AcCapacityFormat read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -65989,34 +88505,74 @@ class ReadThermostatStartOfWeek : public ReadAttribute { } }; -class SubscribeAttributeThermostatStartOfWeek : public SubscribeAttribute { +class WriteThermostatAcCapacityFormat : public WriteAttribute { public: - SubscribeAttributeThermostatStartOfWeek() - : SubscribeAttribute("start-of-week") + WriteThermostatAcCapacityFormat() + : WriteAttribute("ac-capacity-format") { + AddArgument("attr-name", "ac-capacity-format"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); } - ~SubscribeAttributeThermostatStartOfWeek() {} + ~WriteThermostatAcCapacityFormat() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000020) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000047) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + CHIPWriteParams * params = [[CHIPWriteParams alloc] init]; + params.timedWriteTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeAcCapacityFormatWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcCapacityFormat write Error: %s", + chip::ErrorStr(chipError)); + } + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeThermostatAcCapacityFormat : public SubscribeAttribute { +public: + SubscribeAttributeThermostatAcCapacityFormat() + : SubscribeAttribute("ac-capacity-format") + { + } + + ~SubscribeAttributeThermostatAcCapacityFormat() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000047) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeStartOfWeekWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.StartOfWeek response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeAcCapacityFormatWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcCapacityFormat response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -66028,50 +88584,49 @@ class SubscribeAttributeThermostatStartOfWeek : public SubscribeAttribute { }; /* - * Attribute NumberOfWeeklyTransitions + * Attribute GeneratedCommandList */ -class ReadThermostatNumberOfWeeklyTransitions : public ReadAttribute { +class ReadThermostatGeneratedCommandList : public ReadAttribute { public: - ReadThermostatNumberOfWeeklyTransitions() - : ReadAttribute("number-of-weekly-transitions") + ReadThermostatGeneratedCommandList() + : ReadAttribute("generated-command-list") { } - ~ReadThermostatNumberOfWeeklyTransitions() {} + ~ReadThermostatGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat NumberOfWeeklyTransitions read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeThermostatNumberOfWeeklyTransitions : public SubscribeAttribute { +class SubscribeAttributeThermostatGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeThermostatNumberOfWeeklyTransitions() - : SubscribeAttribute("number-of-weekly-transitions") + SubscribeAttributeThermostatGeneratedCommandList() + : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeThermostatNumberOfWeeklyTransitions() {} + ~SubscribeAttributeThermostatGeneratedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000021) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -66079,17 +88634,16 @@ class SubscribeAttributeThermostatNumberOfWeeklyTransitions : public SubscribeAt = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeNumberOfWeeklyTransitionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -66101,50 +88655,49 @@ class SubscribeAttributeThermostatNumberOfWeeklyTransitions : public SubscribeAt }; /* - * Attribute NumberOfDailyTransitions + * Attribute AcceptedCommandList */ -class ReadThermostatNumberOfDailyTransitions : public ReadAttribute { +class ReadThermostatAcceptedCommandList : public ReadAttribute { public: - ReadThermostatNumberOfDailyTransitions() - : ReadAttribute("number-of-daily-transitions") + ReadThermostatAcceptedCommandList() + : ReadAttribute("accepted-command-list") { } - ~ReadThermostatNumberOfDailyTransitions() {} + ~ReadThermostatAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster - readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.NumberOfDailyTransitions response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "Thermostat NumberOfDailyTransitions read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "Thermostat AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributeThermostatNumberOfDailyTransitions : public SubscribeAttribute { +class SubscribeAttributeThermostatAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeThermostatNumberOfDailyTransitions() - : SubscribeAttribute("number-of-daily-transitions") + SubscribeAttributeThermostatAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeThermostatNumberOfDailyTransitions() {} + ~SubscribeAttributeThermostatAcceptedCommandList() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000022) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -66152,17 +88705,16 @@ class SubscribeAttributeThermostatNumberOfDailyTransitions : public SubscribeAtt = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeNumberOfDailyTransitionsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.NumberOfDailyTransitions response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -66979,6 +89531,79 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationAttributeList : publ } }; +/* + * Attribute FeatureMap + */ +class ReadThermostatUserInterfaceConfigurationFeatureMap : public ReadAttribute { +public: + ReadThermostatUserInterfaceConfigurationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadThermostatUserInterfaceConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000204) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostatUserInterfaceConfiguration * cluster = + [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ThermostatUserInterfaceConfiguration.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "ThermostatUserInterfaceConfiguration FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeThermostatUserInterfaceConfigurationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeThermostatUserInterfaceConfigurationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeThermostatUserInterfaceConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000204) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPThermostatUserInterfaceConfiguration * cluster = + [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ThermostatUserInterfaceConfiguration.FeatureMap response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -67140,6 +89765,7 @@ class ThreadNetworkDiagnosticsResetCounts : public ClusterCommand { ThreadNetworkDiagnosticsResetCounts() : ClusterCommand("reset-counts") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } @@ -67174,6 +89800,7 @@ class ThreadNetworkDiagnosticsResetCounts : public ClusterCommand { } private: + chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type mRequest; }; /* @@ -72764,6 +95391,155 @@ class SubscribeAttributeTimeFormatLocalizationAcceptedCommandList : public Subsc } }; +/* + * Attribute AttributeList + */ +class ReadTimeFormatLocalizationAttributeList : public ReadAttribute { +public: + ReadTimeFormatLocalizationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadTimeFormatLocalizationAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002C) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TimeFormatLocalization.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TimeFormatLocalization AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTimeFormatLocalizationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeTimeFormatLocalizationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeTimeFormatLocalizationAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002C) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"TimeFormatLocalization.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadTimeFormatLocalizationFeatureMap : public ReadAttribute { +public: + ReadTimeFormatLocalizationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadTimeFormatLocalizationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002C) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TimeFormatLocalization.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "TimeFormatLocalization FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeTimeFormatLocalizationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeTimeFormatLocalizationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeTimeFormatLocalizationFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002C) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"TimeFormatLocalization.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -72971,6 +95747,156 @@ class SubscribeAttributeUnitLocalizationTemperatureUnit : public SubscribeAttrib } }; +/* + * Attribute GeneratedCommandList + */ +class ReadUnitLocalizationGeneratedCommandList : public ReadAttribute { +public: + ReadUnitLocalizationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadUnitLocalizationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002D) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitLocalization.GeneratedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "UnitLocalization GeneratedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeUnitLocalizationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeUnitLocalizationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeUnitLocalizationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002D) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitLocalization.GeneratedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadUnitLocalizationAcceptedCommandList : public ReadAttribute { +public: + ReadUnitLocalizationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadUnitLocalizationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002D) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitLocalization.AcceptedCommandList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "UnitLocalization AcceptedCommandList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeUnitLocalizationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeUnitLocalizationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeUnitLocalizationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002D) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitLocalization.AcceptedCommandList response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute AttributeList */ @@ -73477,6 +96403,146 @@ class SubscribeAttributeUserLabelAcceptedCommandList : public SubscribeAttribute } }; +/* + * Attribute AttributeList + */ +class ReadUserLabelAttributeList : public ReadAttribute { +public: + ReadUserLabelAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadUserLabelAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000041) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"UserLabel.AttributeList response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "UserLabel AttributeList read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeUserLabelAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeUserLabelAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeUserLabelAttributeList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000041) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"UserLabel.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute FeatureMap + */ +class ReadUserLabelFeatureMap : public ReadAttribute { +public: + ReadUserLabelFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadUserLabelFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000041) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UserLabel.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "UserLabel FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeUserLabelFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeUserLabelFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeUserLabelFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000041) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UserLabel.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -73845,6 +96911,76 @@ class SubscribeAttributeWakeOnLanAttributeList : public SubscribeAttribute { } }; +/* + * Attribute FeatureMap + */ +class ReadWakeOnLanFeatureMap : public ReadAttribute { +public: + ReadWakeOnLanFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadWakeOnLanFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000503) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WakeOnLan.FeatureMap response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "WakeOnLan FeatureMap read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeWakeOnLanFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeWakeOnLanFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeWakeOnLanFeatureMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000503) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WakeOnLan.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ClusterRevision */ @@ -73955,6 +97091,7 @@ class WiFiNetworkDiagnosticsResetCounts : public ClusterCommand { WiFiNetworkDiagnosticsResetCounts() : ClusterCommand("reset-counts") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } @@ -73989,6 +97126,7 @@ class WiFiNetworkDiagnosticsResetCounts : public ClusterCommand { } private: + chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Type mRequest; }; /* @@ -75379,6 +98517,50 @@ class SubscribeAttributeWiFiNetworkDiagnosticsClusterRevision : public Subscribe | Events: | | \*----------------------------------------------------------------------------*/ +/* + * Command UpOrOpen + */ +class WindowCoveringUpOrOpen : public ClusterCommand { +public: + WindowCoveringUpOrOpen() + : ClusterCommand("up-or-open") + { + (void) mRequest; // Might not be used if we have no complex args + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + __auto_type * params = [[CHIPWindowCoveringClusterUpOrOpenParams 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 upOrOpenWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return chipError; + } + +private: + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type mRequest; +}; + /* * Command DownOrClose */ @@ -75387,6 +98569,7 @@ class WindowCoveringDownOrClose : public ClusterCommand { WindowCoveringDownOrClose() : ClusterCommand("down-or-close") { + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } @@ -75419,57 +98602,51 @@ class WindowCoveringDownOrClose : public ClusterCommand { } private: + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type mRequest; }; /* - * Command GoToLiftPercentage + * Command StopMotion */ -class WindowCoveringGoToLiftPercentage : public ClusterCommand { +class WindowCoveringStopMotion : public ClusterCommand { public: - WindowCoveringGoToLiftPercentage() - : ClusterCommand("go-to-lift-percentage") + WindowCoveringStopMotion() + : ClusterCommand("stop-motion") { - AddArgument("LiftPercentageValue", 0, UINT8_MAX, &mLiftPercentageValue); - AddArgument("LiftPercent100thsValue", 0, UINT16_MAX, &mLiftPercent100thsValue); + (void) mRequest; // Might not be used if we have no complex args ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000005) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + __auto_type * params = [[CHIPWindowCoveringClusterStopMotionParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.liftPercentageValue = [NSNumber numberWithUnsignedChar:mLiftPercentageValue]; - if (mLiftPercent100thsValue.HasValue()) { - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue.Value()]; - } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster goToLiftPercentageWithParams:params - completionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: - chip::Percent mLiftPercentageValue; - chip::Optional mLiftPercent100thsValue; + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type mRequest; }; /* @@ -75480,6 +98657,7 @@ class WindowCoveringGoToLiftValue : public ClusterCommand { WindowCoveringGoToLiftValue() : ClusterCommand("go-to-lift-value") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("LiftValue", 0, UINT16_MAX, &mLiftValue); ClusterCommand::AddArguments(); } @@ -75515,40 +98693,42 @@ class WindowCoveringGoToLiftValue : public ClusterCommand { } private: + chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::Type mRequest; uint16_t mLiftValue; }; /* - * Command GoToTiltPercentage + * Command GoToLiftPercentage */ -class WindowCoveringGoToTiltPercentage : public ClusterCommand { +class WindowCoveringGoToLiftPercentage : public ClusterCommand { public: - WindowCoveringGoToTiltPercentage() - : ClusterCommand("go-to-tilt-percentage") + WindowCoveringGoToLiftPercentage() + : ClusterCommand("go-to-lift-percentage") { - AddArgument("TiltPercentageValue", 0, UINT8_MAX, &mTiltPercentageValue); - AddArgument("TiltPercent100thsValue", 0, UINT16_MAX, &mTiltPercent100thsValue); + (void) mRequest; // Might not be used if we have no complex args + AddArgument("LiftPercentageValue", 0, UINT8_MAX, &mLiftPercentageValue); + AddArgument("LiftPercent100thsValue", 0, UINT16_MAX, &mLiftPercent100thsValue); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000008) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:mTiltPercentageValue]; - if (mTiltPercent100thsValue.HasValue()) { - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue.Value()]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:mLiftPercentageValue]; + if (mLiftPercent100thsValue.HasValue()) { + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue.Value()]; } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster goToTiltPercentageWithParams:params + [cluster goToLiftPercentageWithParams:params completionHandler:^(NSError * _Nullable error) { chipError = [CHIPError errorToCHIPErrorCode:error]; responsesNeeded--; @@ -75565,8 +98745,9 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { } private: - chip::Percent mTiltPercentageValue; - chip::Optional mTiltPercent100thsValue; + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type mRequest; + chip::Percent mLiftPercentageValue; + chip::Optional mLiftPercent100thsValue; }; /* @@ -75577,6 +98758,7 @@ class WindowCoveringGoToTiltValue : public ClusterCommand { WindowCoveringGoToTiltValue() : ClusterCommand("go-to-tilt-value") { + (void) mRequest; // Might not be used if we have no complex args AddArgument("TiltValue", 0, UINT16_MAX, &mTiltValue); ClusterCommand::AddArguments(); } @@ -75612,91 +98794,61 @@ class WindowCoveringGoToTiltValue : public ClusterCommand { } private: + chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::Type mRequest; uint16_t mTiltValue; }; /* - * Command StopMotion + * Command GoToTiltPercentage */ -class WindowCoveringStopMotion : public ClusterCommand { +class WindowCoveringGoToTiltPercentage : public ClusterCommand { public: - WindowCoveringStopMotion() - : ClusterCommand("stop-motion") + WindowCoveringGoToTiltPercentage() + : ClusterCommand("go-to-tilt-percentage") { + (void) mRequest; // Might not be used if we have no complex args + AddArgument("TiltPercentageValue", 0, UINT8_MAX, &mTiltPercentageValue); + AddArgument("TiltPercent100thsValue", 0, UINT16_MAX, &mTiltPercent100thsValue); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000002) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000008) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPWindowCoveringClusterStopMotionParams alloc] init]; + __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams 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 stopMotionWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:mTiltPercentageValue]; + if (mTiltPercent100thsValue.HasValue()) { + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue.Value()]; } - return chipError; - } - -private: -}; - -/* - * Command UpOrOpen - */ -class WindowCoveringUpOrOpen : public ClusterCommand { -public: - WindowCoveringUpOrOpen() - : ClusterCommand("up-or-open") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000102) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block chipError = CHIP_NO_ERROR; - __auto_type * params = [[CHIPWindowCoveringClusterUpOrOpenParams 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 upOrOpenWithCompletionHandler:^(NSError * _Nullable error) { - chipError = [CHIPError errorToCHIPErrorCode:error]; - responsesNeeded--; - if (chipError != CHIP_NO_ERROR) { - mError = chipError; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster goToTiltPercentageWithParams:params + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + responsesNeeded--; + if (chipError != CHIP_NO_ERROR) { + mError = chipError; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return chipError; } private: + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type mRequest; + chip::Percent mTiltPercentageValue; + chip::Optional mTiltPercent100thsValue; }; /* @@ -75769,6 +98921,150 @@ class SubscribeAttributeWindowCoveringType : public SubscribeAttribute { } }; +/* + * Attribute PhysicalClosedLimitLift + */ +class ReadWindowCoveringPhysicalClosedLimitLift : public ReadAttribute { +public: + ReadWindowCoveringPhysicalClosedLimitLift() + : ReadAttribute("physical-closed-limit-lift") + { + } + + ~ReadWindowCoveringPhysicalClosedLimitLift() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributePhysicalClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.PhysicalClosedLimitLift response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "WindowCovering PhysicalClosedLimitLift read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeWindowCoveringPhysicalClosedLimitLift : public SubscribeAttribute { +public: + SubscribeAttributeWindowCoveringPhysicalClosedLimitLift() + : SubscribeAttribute("physical-closed-limit-lift") + { + } + + ~SubscribeAttributeWindowCoveringPhysicalClosedLimitLift() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePhysicalClosedLimitLiftWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.PhysicalClosedLimitLift response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute PhysicalClosedLimitTilt + */ +class ReadWindowCoveringPhysicalClosedLimitTilt : public ReadAttribute { +public: + ReadWindowCoveringPhysicalClosedLimitTilt() + : ReadAttribute("physical-closed-limit-tilt") + { + } + + ~ReadWindowCoveringPhysicalClosedLimitTilt() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributePhysicalClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.PhysicalClosedLimitTilt response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "WindowCovering PhysicalClosedLimitTilt read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeWindowCoveringPhysicalClosedLimitTilt : public SubscribeAttribute { +public: + SubscribeAttributeWindowCoveringPhysicalClosedLimitTilt() + : SubscribeAttribute("physical-closed-limit-tilt") + { + } + + ~SubscribeAttributeWindowCoveringPhysicalClosedLimitTilt() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePhysicalClosedLimitTiltWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.PhysicalClosedLimitTilt response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute CurrentPositionLift */ @@ -75911,6 +99207,148 @@ class SubscribeAttributeWindowCoveringCurrentPositionTilt : public SubscribeAttr } }; +/* + * Attribute NumberOfActuationsLift + */ +class ReadWindowCoveringNumberOfActuationsLift : public ReadAttribute { +public: + ReadWindowCoveringNumberOfActuationsLift() + : ReadAttribute("number-of-actuations-lift") + { + } + + ~ReadWindowCoveringNumberOfActuationsLift() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeNumberOfActuationsLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.NumberOfActuationsLift response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "WindowCovering NumberOfActuationsLift read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeWindowCoveringNumberOfActuationsLift : public SubscribeAttribute { +public: + SubscribeAttributeWindowCoveringNumberOfActuationsLift() + : SubscribeAttribute("number-of-actuations-lift") + { + } + + ~SubscribeAttributeWindowCoveringNumberOfActuationsLift() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeNumberOfActuationsLiftWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.NumberOfActuationsLift response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute NumberOfActuationsTilt + */ +class ReadWindowCoveringNumberOfActuationsTilt : public ReadAttribute { +public: + ReadWindowCoveringNumberOfActuationsTilt() + : ReadAttribute("number-of-actuations-tilt") + { + } + + ~ReadWindowCoveringNumberOfActuationsTilt() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReadAttribute (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeNumberOfActuationsTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.NumberOfActuationsTilt response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "WindowCovering NumberOfActuationsTilt read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributeWindowCoveringNumberOfActuationsTilt : public SubscribeAttribute { +public: + SubscribeAttributeWindowCoveringNumberOfActuationsTilt() + : SubscribeAttribute("number-of-actuations-tilt") + { + } + + ~SubscribeAttributeWindowCoveringNumberOfActuationsTilt() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000102) ReportAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeNumberOfActuationsTiltWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WindowCovering.NumberOfActuationsTilt response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute ConfigStatus */ @@ -77421,6 +100859,8 @@ void registerClusterAccessControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77447,6 +100887,8 @@ void registerClusterAccountLogin(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77461,8 +100903,8 @@ void registerClusterAdministratorCommissioning(Commands & commands) commands_list clusterCommands = { make_unique(Id), // - make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(Id), // make_unique(), // @@ -77479,6 +100921,8 @@ void registerClusterAdministratorCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77518,6 +100962,8 @@ void registerClusterApplicationBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77532,9 +100978,9 @@ void registerClusterApplicationLauncher(Commands & commands) commands_list clusterCommands = { make_unique(Id), // - make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -77549,6 +100995,8 @@ void registerClusterApplicationLauncher(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77563,8 +101011,8 @@ void registerClusterAudioOutput(Commands & commands) commands_list clusterCommands = { make_unique(Id), // - make_unique(), // make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -77578,6 +101026,8 @@ void registerClusterAudioOutput(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77603,6 +101053,24 @@ void registerClusterBarrierControl(Commands & commands) 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(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -77611,6 +101079,8 @@ void registerClusterBarrierControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77625,6 +101095,7 @@ void registerClusterBasic(Commands & commands) commands_list clusterCommands = { make_unique(Id), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -77677,6 +101148,8 @@ void registerClusterBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77692,22 +101165,40 @@ void registerClusterBinaryInputBasic(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(Id), // - make_unique(), // + make_unique(), // make_unique(Id), // - make_unique(), // + make_unique(), // 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(), // + 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(), // }; @@ -77734,6 +101225,8 @@ void registerClusterBinding(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77759,6 +101252,8 @@ void registerClusterBooleanState(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77773,18 +101268,18 @@ void registerClusterBridgedActions(Commands & commands) commands_list clusterCommands = { 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(), // + make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -77800,6 +101295,8 @@ void registerClusterBridgedActions(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77854,6 +101351,8 @@ void registerClusterBridgedDeviceBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77886,6 +101385,8 @@ void registerClusterChannel(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -77900,25 +101401,25 @@ void registerClusterColorControl(Commands & commands) commands_list clusterCommands = { 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(), // - 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(Id), // make_unique(), // make_unique(Id), // @@ -78045,6 +101546,8 @@ void registerClusterColorControl(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78075,6 +101578,8 @@ void registerClusterContentLauncher(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78106,6 +101611,8 @@ void registerClusterDescriptor(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78130,6 +101637,10 @@ void registerClusterDiagnosticLogs(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -78142,24 +101653,39 @@ void registerClusterDoorLock(Commands & commands) commands_list clusterCommands = { 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(), // + 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(), // + 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(Id), // make_unique(), // make_unique(Id), // @@ -78171,6 +101697,17 @@ void registerClusterDoorLock(Commands & commands) 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(), // @@ -78191,9 +101728,17 @@ void registerClusterDoorLock(Commands & commands) 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(), // @@ -78205,26 +101750,70 @@ void registerClusterDoorLock(Commands & commands) 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(), // + 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(), // + 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(), // + 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(), // make_unique(), // }; @@ -78239,13 +101828,103 @@ void registerClusterElectricalMeasurement(Commands & commands) commands_list clusterCommands = { make_unique(Id), // + 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(), // + 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(), // + 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(), // + 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(), // + 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(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -78264,12 +101943,168 @@ void registerClusterElectricalMeasurement(Commands & commands) 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(), // + 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(), // + 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(), // + 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(), // + 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(), // + 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(), // + 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(), // + 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(), // + 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(), // + 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(), // }; @@ -78392,6 +102227,8 @@ void registerClusterFixedLabel(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78423,6 +102260,8 @@ void registerClusterFlowMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78438,8 +102277,8 @@ void registerClusterGeneralCommissioning(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // - make_unique(), // make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -78460,6 +102299,8 @@ void registerClusterGeneralCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78499,6 +102340,8 @@ void registerClusterGeneralDiagnostics(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78513,10 +102356,10 @@ void registerClusterGroupKeyManagement(Commands & commands) commands_list clusterCommands = { make_unique(Id), // + make_unique(), // make_unique(), // - make_unique(), // make_unique(), // - make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -78535,6 +102378,8 @@ void registerClusterGroupKeyManagement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78550,11 +102395,11 @@ void registerClusterGroups(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // - make_unique(), // + make_unique(), // make_unique(), // - make_unique(), // make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -78566,6 +102411,8 @@ void registerClusterGroups(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78597,6 +102444,8 @@ void registerClusterIdentify(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78630,6 +102479,8 @@ void registerClusterIlluminanceMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78654,6 +102505,8 @@ void registerClusterKeypadInput(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78668,13 +102521,13 @@ void registerClusterLevelControl(Commands & commands) commands_list clusterCommands = { 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(Id), // make_unique(), // @@ -78748,6 +102601,10 @@ void registerClusterLocalizationConfiguration(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78772,6 +102629,8 @@ void registerClusterLowPower(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78786,10 +102645,10 @@ void registerClusterMediaInput(Commands & commands) commands_list clusterCommands = { make_unique(Id), // - make_unique(), // - make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -78803,6 +102662,8 @@ void registerClusterMediaInput(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78817,17 +102678,17 @@ void registerClusterMediaPlayback(Commands & commands) commands_list clusterCommands = { 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(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -78851,6 +102712,8 @@ void registerClusterMediaPlayback(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -78905,12 +102768,12 @@ void registerClusterNetworkCommissioning(Commands & commands) commands_list clusterCommands = { make_unique(Id), // - make_unique(), // + make_unique(), // make_unique(), // - make_unique(), // + make_unique(), // make_unique(), // + make_unique(), // make_unique(), // - make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -78935,6 +102798,8 @@ void registerClusterNetworkCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -78951,14 +102816,20 @@ void registerClusterOtaSoftwareUpdateProvider(Commands & commands) commands_list clusterCommands = { make_unique(Id), // + make_unique(), // make_unique(), // make_unique(), // - make_unique(), // make_unique(Id), // - make_unique(), // + 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(), // }; @@ -78986,8 +102857,14 @@ void registerClusterOtaSoftwareUpdateRequestor(Commands & commands) 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(), // }; @@ -79011,12 +102888,41 @@ void registerClusterOccupancySensing(Commands & commands) 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(), // + 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(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79032,11 +102938,11 @@ void registerClusterOnOff(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // - make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // - make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -79089,6 +102995,8 @@ void registerClusterOnOffSwitchConfiguration(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79103,15 +103011,15 @@ void registerClusterOperationalCredentials(Commands & commands) commands_list clusterCommands = { 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(Id), // make_unique(), // make_unique(Id), // @@ -79133,6 +103041,8 @@ void registerClusterOperationalCredentials(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79245,6 +103155,8 @@ void registerClusterPowerSourceConfiguration(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79280,8 +103192,14 @@ void registerClusterPressureMeasurement(Commands & commands) 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(), // }; @@ -79390,6 +103308,8 @@ void registerClusterRelativeHumidityMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79405,12 +103325,15 @@ void registerClusterScenes(Commands & commands) commands_list clusterCommands = { 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(Id), // make_unique(), // make_unique(Id), // @@ -79424,12 +103347,16 @@ void registerClusterScenes(Commands & commands) 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(), // }; @@ -79523,6 +103450,8 @@ void registerClusterTargetNavigator(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79548,8 +103477,14 @@ void registerClusterTemperatureMeasurement(Commands & commands) 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(), // }; @@ -79564,24 +103499,28 @@ void registerClusterTestCluster(Commands & commands) commands_list clusterCommands = { 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(), // + 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(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -79834,6 +103773,8 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -79848,16 +103789,20 @@ void registerClusterThermostat(Commands & commands) commands_list clusterCommands = { make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // - 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(), // @@ -79866,12 +103811,28 @@ void registerClusterThermostat(Commands & commands) 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(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -79887,18 +103848,69 @@ void registerClusterThermostat(Commands & commands) 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(), // 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(), // + 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(), // + 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(), // make_unique(), // @@ -79935,6 +103947,8 @@ void registerClusterThermostatUserInterfaceConfiguration(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -80116,6 +104130,10 @@ void registerClusterTimeFormatLocalization(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -80136,6 +104154,10 @@ void registerClusterUnitLocalization(Commands & commands) make_unique(), // make_unique(Id), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -80164,6 +104186,10 @@ void registerClusterUserLabel(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -80189,6 +104215,8 @@ void registerClusterWakeOnLan(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // }; @@ -80255,22 +104283,30 @@ void registerClusterWindowCovering(Commands & commands) commands_list clusterCommands = { 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(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(), //