diff --git a/examples/chip-tool-darwin/BUILD.gn b/examples/chip-tool-darwin/BUILD.gn index 3c7d64b09a35fb..d79a9b633a6ae3 100644 --- a/examples/chip-tool-darwin/BUILD.gn +++ b/examples/chip-tool-darwin/BUILD.gn @@ -22,6 +22,7 @@ assert(chip_build_tools) executable("chip-tool-darwin") { sources = [ "${chip_root}/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm", + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", "commands/clusters/ModelCommandBridge.mm", "commands/common/CHIPCommandBridge.mm", "commands/common/CHIPCommandStorageDelegate.mm", @@ -35,6 +36,7 @@ executable("chip-tool-darwin") { include_dirs = [ ".", "${chip_root}/zzz_generated/chip-tool-darwin", + "${chip_root}/examples/chip-tool/commands/clusters/ComplexArgument.h", ] deps = [ diff --git a/examples/chip-tool-darwin/templates/commands.zapt b/examples/chip-tool-darwin/templates/commands.zapt index 61ad1914a2abbd..43cb463c9a9260 100644 --- a/examples/chip-tool-darwin/templates/commands.zapt +++ b/examples/chip-tool-darwin/templates/commands.zapt @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -24,17 +25,16 @@ class {{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}: public ModelCommand { public: - {{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}(): ModelCommand("{{asDelimitedCommand name}}") + {{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}(): ModelCommand("{{asDelimitedCommand name}}"){{#zcl_command_arguments}}{{#if_chip_complex}}, mComplex_{{asUpperCamelCase label}}(&mRequest.{{asLowerCamelCase label}}){{/if_chip_complex}}{{/zcl_command_arguments}} { {{#chip_cluster_command_arguments}} - {{~#*inline "field"}}m{{asUpperCamelCase label}}{{/inline~}} - {{#if isArray}} - {{else if isStruct}} + {{#if_chip_complex}} + AddArgument("{{asUpperCamelCase label}}", &mComplex_{{asUpperCamelCase label}}); {{else if (isString type)}} - AddArgument("{{asUpperCamelCase label}}", &{{>field}}); + AddArgument("{{asUpperCamelCase label}}", &m{{asUpperCamelCase label}}); {{else}} - AddArgument("{{asUpperCamelCase label}}", {{asTypeMinValue type}}, {{asTypeMaxValue type}}, &{{>field}}); - {{/if}} + AddArgument("{{asUpperCamelCase label}}", {{asTypeMinValue type}}, {{asTypeMaxValue type}}, &m{{asUpperCamelCase label}}); + {{/if_chip_complex}} {{/chip_cluster_command_arguments}} ModelCommand::AddArguments(); } @@ -45,24 +45,21 @@ public: dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIP{{asUpperCamelCase clusterName}} * cluster = [[CHIP{{asUpperCamelCase clusterName}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; {{#chip_cluster_command_arguments}} {{#first}} __auto_type * params = [[CHIP{{asUpperCamelCase parent.clusterName}}Cluster{{asUpperCamelCase parent.name}}Params alloc] init]; {{/first}} - {{~#*inline "field"}}m{{asUpperCamelCase label}}{{/inline~}} - {{#if isArray}} - // {{label}} Array parsing is not supported yet - {{else if isStruct}} - // {{label}} Struct parsing is not supported yet + {{#if_chip_complex}} + {{>decodable_value target=(concat "params." (asStructPropertyName label)) source=(concat "mRequest." (asStructPropertyName label)) cluster=parent.clusterName type=type depth=0}} {{else if (isOctetString type)}} - params.{{asStructPropertyName label}} = [[NSData alloc] initWithBytes:{{>field}}.data() length:{{>field}}.size()]; + params.{{asStructPropertyName label}} = [[NSData alloc] initWithBytes:m{{asUpperCamelCase label}}.data() length:m{{asUpperCamelCase label}}.size()]; {{else if (isString type)}} - params.{{asStructPropertyName label}} = [[NSString alloc] initWithBytes:{{>field}}.data() length:{{>field}}.size() encoding:NSUTF8StringEncoding]; + params.{{asStructPropertyName label}} = [[NSString alloc] initWithBytes:m{{asUpperCamelCase label}}.data() length:m{{asUpperCamelCase label}}.size() encoding:NSUTF8StringEncoding]; {{else}} - params.{{asStructPropertyName label}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{>field}}]; - {{/if}} + params.{{asStructPropertyName label}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:m{{asUpperCamelCase label}}]; + {{/if_chip_complex}} {{/chip_cluster_command_arguments}} [cluster {{asLowerCamelCase name}}With{{#if (hasArguments)}}Params:params completionHandler:{{else}}CompletionHandler:{{/if}} {{#if hasSpecificResponse}} @@ -71,24 +68,25 @@ public: {{else}} ^(NSError * _Nullable error) { {{/if}} - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: {{#chip_cluster_command_arguments}} - {{#if isArray}} - {{else if isStruct}} + {{#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 (isOctetString type)}} chip::ByteSpan m{{asUpperCamelCase label}}; {{else if (isCharString type)}} chip::ByteSpan m{{asUpperCamelCase label}}; {{else}} {{chipType}} m{{asUpperCamelCase label}}; - {{/if}} + {{/if_chip_complex}} {{/chip_cluster_command_arguments}} }; @@ -144,21 +142,19 @@ public: {{#if isWritableAttribute}} {{! No list support for writing yet. Need to figure out how to represent the values. }} -{{#unless isArray}} class Write{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}: public ModelCommand { public: - Write{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}(): ModelCommand("write") + Write{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}(): ModelCommand("write"){{#if_chip_complex}}, mComplex(&mValue){{/if_chip_complex}} { AddArgument("attr-name", "{{asDelimitedCommand (asUpperCamelCase name)}}"); - {{#if isArray}} - // {{label}} Array parsing is not supported yet - {{else if isStruct}} + {{#if_chip_complex}} + AddArgument("attr-value", &mComplex); {{else if (isString type)}} AddArgument("attr-value", &mValue); {{else}} AddArgument("attr-value", {{asTypeMinValue type}}, {{asTypeMaxValue type}}, &mValue); - {{/if}} + {{/if_chip_complex}} ModelCommand::AddArguments(); } @@ -171,41 +167,40 @@ public: ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) WriteAttribute ({{asHex code 8}}) on endpoint %" PRIu16, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIP{{asUpperCamelCase parent.name}} * cluster = [[CHIP{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; - {{#if isArray}} - // {{label}} Array parsing is not supported yet - {{else if isStruct}} - CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase type}} * value = [[CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase type}} alloc] init]; + {{#if_chip_complex}} + {{asObjectiveCType type parent.name}} value; + {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} {{else if (isOctetString type)}} {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; {{else if (isString type)}} {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; {{else}} {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue]; - {{/if}} + {{/if_chip_complex}} [cluster writeAttribute{{asUpperCamelCase name}}WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: - {{#if isArray}} - {{else if isStruct}} + {{#if_chip_complex}} + {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}} mValue; + TypedComplexArgument<{{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}}> mComplex; {{else if (isOctetString type)}} chip::ByteSpan mValue; {{else if (isCharString type)}} chip::ByteSpan mValue; {{else}} {{chipType}} mValue; - {{/if}} + {{/if_chip_complex}} }; -{{/unless}} {{/if}} {{#if isReportableAttribute}} class SubscribeAttribute{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}: public ModelCommand @@ -274,11 +269,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) {{! TODO: Various types (floats, structs) not supported here. }} make_unique(), // {{#if isWritableAttribute}} - {{! No list support for writing yet. Need to figure out how to - represent the values. }} - {{#unless isArray}} make_unique(), // - {{/unless}} {{/if}} {{#if isReportableAttribute}} make_unique(), // diff --git a/examples/chip-tool-darwin/templates/partials/decodable_value.zapt b/examples/chip-tool-darwin/templates/partials/decodable_value.zapt new file mode 100644 index 00000000000000..4909094658d573 --- /dev/null +++ b/examples/chip-tool-darwin/templates/partials/decodable_value.zapt @@ -0,0 +1,44 @@ +{{#if isOptional}} + if ({{source}}.HasValue()) { + {{>decodable_value target=target source=(concat source ".Value()") cluster=cluster depth=(incrementDepth depth) isOptional=false}} + } else { + {{target}} = nil; + } +{{else if isNullable}} + if ({{source}}.IsNull()) { + {{target}} = nil; + } else { + {{>decodable_value target=target source=(concat source ".Value()") cluster=cluster depth=(incrementDepth depth) isNullable=false}} + } +{{else if isArray}} + { // Scope for our temporary variables + auto * array_{{depth}} = [NSMutableArray new]; + for (auto & entry_{{depth}} : {{source}}) { + {{asObjectiveCClass type cluster forceNotList=true}} * newElement_{{depth}}; + {{>decodable_value target=(concat "newElement_" depth) source=(concat "entry_" depth) cluster=cluster depth=(incrementDepth depth) isArray=false}} + [array_{{depth}} addObject:newElement_{{depth}}]; + } + {{target}} = array_{{depth}}; + } +{{else}} + {{#if_is_struct type}} + {{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new]; + {{#zcl_struct_items_by_struct_name type}} + {{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }} + {{/zcl_struct_items_by_struct_name}} + {{else}} + {{#if_chip_enum type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; + {{else}} + {{#if_is_bitmap type}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()]; + {{else if (isOctetString type)}} + {{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()]; + {{else if (isCharString type)}} + {{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding]; + {{else}} + {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; + {{/if_is_bitmap}} + {{/if_chip_enum}} + {{/if_is_struct}} +{{/if}} diff --git a/examples/chip-tool-darwin/templates/templates.json b/examples/chip-tool-darwin/templates/templates.json index d72564165f9a5b..60c6f6dca50d77 100644 --- a/examples/chip-tool-darwin/templates/templates.json +++ b/examples/chip-tool-darwin/templates/templates.json @@ -34,6 +34,10 @@ "name": "encode_value", "path": "../../../src/darwin/Framework/CHIP/templates/partials/encode_value.zapt" }, + { + "name": "decodable_value", + "path": "partials/decodable_value.zapt" + }, { "name": "decode_value", "path": "../../../src/darwin/Framework/CHIP/templates/partials/decode_value.zapt" 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 c3a5302311b1c8..c8aafba2051cd9 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -27,6 +27,7 @@ #include #include +#include #include /*----------------------------------------------------------------------------*\ @@ -204,6 +205,96 @@ class ReadAccessControlAcl : public ModelCommand { } }; +class WriteAccessControlAcl : public ModelCommand { +public: + WriteAccessControlAcl() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "acl"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteAccessControlAcl() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001F) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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 chipError = CHIP_NO_ERROR; + + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPAccessControlClusterAccessControlEntry * newElement_0; + newElement_0 = [CHIPAccessControlClusterAccessControlEntry new]; + newElement_0.privilege = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.privilege)]; + newElement_0.authMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.authMode)]; + if (entry_0.subjects.IsNull()) { + newElement_0.subjects = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.subjects.Value()) { + NSNumber * newElement_3; + newElement_3 = [NSNumber numberWithUnsignedLongLong:entry_3]; + [array_3 addObject:newElement_3]; + } + newElement_0.subjects = array_3; + } + } + if (entry_0.targets.IsNull()) { + newElement_0.targets = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.targets.Value()) { + CHIPAccessControlClusterTarget * newElement_3; + newElement_3 = [CHIPAccessControlClusterTarget new]; + if (entry_3.cluster.IsNull()) { + newElement_3.cluster = nil; + } else { + newElement_3.cluster = [NSNumber numberWithUnsignedInt:entry_3.cluster.Value()]; + } + if (entry_3.endpoint.IsNull()) { + newElement_3.endpoint = nil; + } else { + newElement_3.endpoint = [NSNumber numberWithUnsignedShort:entry_3.endpoint.Value()]; + } + if (entry_3.deviceType.IsNull()) { + newElement_3.deviceType = nil; + } else { + newElement_3.deviceType = [NSNumber numberWithUnsignedInt:entry_3.deviceType.Value()]; + } + [array_3 addObject:newElement_3]; + } + newElement_0.targets = array_3; + } + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeAclWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "AccessControl Acl Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> + mComplex; +}; + class SubscribeAttributeAccessControlAcl : public ModelCommand { public: SubscribeAttributeAccessControlAcl() @@ -283,6 +374,54 @@ class ReadAccessControlExtension : public ModelCommand { } }; +class WriteAccessControlExtension : public ModelCommand { +public: + WriteAccessControlExtension() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "extension"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteAccessControlExtension() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001F) WriteAttribute (0x00000001) on endpoint %" PRIu16, 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 chipError = CHIP_NO_ERROR; + + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPAccessControlClusterExtensionEntry * newElement_0; + newElement_0 = [CHIPAccessControlClusterExtensionEntry new]; + newElement_0.data = [NSData dataWithBytes:entry_0.data.data() length:entry_0.data.size()]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeExtensionWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "AccessControl Extension Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> + mComplex; +}; + class SubscribeAttributeAccessControlExtension : public ModelCommand { public: SubscribeAttributeAccessControlExtension() @@ -674,8 +813,9 @@ class AccountLoginGetSetupPIN : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPAccountLoginClusterGetSetupPINParams alloc] init]; + params.tempAccountIdentifier = [[NSString alloc] initWithBytes:mTempAccountIdentifier.data() length:mTempAccountIdentifier.size() encoding:NSUTF8StringEncoding]; @@ -683,11 +823,11 @@ class AccountLoginGetSetupPIN : public ModelCommand { completionHandler:^( CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -713,19 +853,21 @@ class AccountLoginLogin : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPAccountLoginClusterLoginParams alloc] init]; + params.tempAccountIdentifier = [[NSString alloc] initWithBytes:mTempAccountIdentifier.data() length:mTempAccountIdentifier.size() encoding:NSUTF8StringEncoding]; + params.setupPIN = [[NSString alloc] initWithBytes:mSetupPIN.data() length:mSetupPIN.size() encoding:NSUTF8StringEncoding]; [cluster loginWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -750,13 +892,13 @@ class AccountLoginLogout : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster logoutWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -1113,16 +1255,17 @@ class AdministratorCommissioningOpenBasicCommissioningWindow : public ModelComma CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:mCommissioningTimeout]; [cluster openBasicCommissioningWindowWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -1153,20 +1296,25 @@ class AdministratorCommissioningOpenCommissioningWindow : public ModelCommand { CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPAdministratorCommissioningClusterOpenCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:mCommissioningTimeout]; + params.pakeVerifier = [[NSData alloc] initWithBytes:mPAKEVerifier.data() length:mPAKEVerifier.size()]; + params.discriminator = [NSNumber numberWithUnsignedShort:mDiscriminator]; + params.iterations = [NSNumber numberWithUnsignedInt:mIterations]; + params.salt = [[NSData alloc] initWithBytes:mSalt.data() length:mSalt.size()]; [cluster openCommissioningWindowWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -1196,13 +1344,13 @@ class AdministratorCommissioningRevokeCommissioning : public ModelCommand { CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -2811,7 +2959,9 @@ class ApplicationLauncherHideApp : public ModelCommand { public: ApplicationLauncherHideApp() : ModelCommand("hide-app") + , mComplex_Application(&mRequest.application) { + AddArgument("Application", &mComplex_Application); ModelCommand::AddArguments(); } @@ -2823,21 +2973,28 @@ class ApplicationLauncherHideApp : public ModelCommand { CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPApplicationLauncherClusterHideAppParams alloc] init]; - // application Struct parsing is not supported yet + + params.application = [CHIPApplicationLauncherClusterApplication new]; + params.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mRequest.application.catalogVendorId]; + params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() + length:mRequest.application.applicationId.size() + encoding:NSUTF8StringEncoding]; [cluster hideAppWithParams:params completionHandler:^( CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; + TypedComplexArgument mComplex_Application; }; /* @@ -2847,7 +3004,9 @@ class ApplicationLauncherLaunchApp : public ModelCommand { public: ApplicationLauncherLaunchApp() : ModelCommand("launch-app") + , mComplex_Application(&mRequest.application) { + AddArgument("Application", &mComplex_Application); AddArgument("Data", &mData); ModelCommand::AddArguments(); } @@ -2860,22 +3019,30 @@ class ApplicationLauncherLaunchApp : public ModelCommand { CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPApplicationLauncherClusterLaunchAppParams alloc] init]; - // application Struct parsing is not supported yet + + params.application = [CHIPApplicationLauncherClusterApplication new]; + params.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mRequest.application.catalogVendorId]; + params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() + length:mRequest.application.applicationId.size() + encoding:NSUTF8StringEncoding]; + params.data = [[NSData alloc] initWithBytes:mData.data() length:mData.size()]; [cluster launchAppWithParams:params completionHandler:^( CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; + TypedComplexArgument mComplex_Application; chip::ByteSpan mData; }; @@ -2886,7 +3053,9 @@ class ApplicationLauncherStopApp : public ModelCommand { public: ApplicationLauncherStopApp() : ModelCommand("stop-app") + , mComplex_Application(&mRequest.application) { + AddArgument("Application", &mComplex_Application); ModelCommand::AddArguments(); } @@ -2898,21 +3067,28 @@ class ApplicationLauncherStopApp : public ModelCommand { CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPApplicationLauncherClusterStopAppParams alloc] init]; - // application Struct parsing is not supported yet + + params.application = [CHIPApplicationLauncherClusterApplication new]; + params.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mRequest.application.catalogVendorId]; + params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() + length:mRequest.application.applicationId.size() + encoding:NSUTF8StringEncoding]; [cluster stopAppWithParams:params completionHandler:^( CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; + TypedComplexArgument mComplex_Application; }; /* @@ -3035,8 +3211,10 @@ class WriteApplicationLauncherCurrentApp : public ModelCommand { public: WriteApplicationLauncherCurrentApp() : ModelCommand("write") + , mComplex(&mValue) { AddArgument("attr-name", "current-app"); + AddArgument("attr-value", &mComplex); ModelCommand::AddArguments(); } @@ -3049,20 +3227,38 @@ class WriteApplicationLauncherCurrentApp : public ModelCommand { CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; - - CHIPApplicationLauncherClusterApplicationEP * value = [[CHIPApplicationLauncherClusterApplicationEP alloc] init]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + CHIPApplicationLauncherClusterApplicationEP * _Nullable value; + if (mValue.IsNull()) { + value = nil; + } else { + value = [CHIPApplicationLauncherClusterApplicationEP new]; + value.application = [CHIPApplicationLauncherClusterApplication new]; + value.application.catalogVendorId = [NSNumber numberWithUnsignedShort:mValue.Value().application.catalogVendorId]; + value.application.applicationId = [[NSString alloc] initWithBytes:mValue.Value().application.applicationId.data() + length:mValue.Value().application.applicationId.size() + encoding:NSUTF8StringEncoding]; + if (mValue.Value().endpoint.HasValue()) { + value.endpoint = [NSNumber numberWithUnsignedShort:mValue.Value().endpoint.Value()]; + } else { + value.endpoint = nil; + } + } [cluster writeAttributeCurrentAppWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ApplicationLauncher CurrentApp Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ApplicationLauncher CurrentApp Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::DataModel::Nullable mValue; + TypedComplexArgument> + mComplex; }; class SubscribeAttributeApplicationLauncherCurrentApp : public ModelCommand { @@ -3478,17 +3674,19 @@ class AudioOutputRenameOutput : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPAudioOutputClusterRenameOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:mIndex]; + params.name = [[NSString alloc] initWithBytes:mName.data() length:mName.size() encoding:NSUTF8StringEncoding]; [cluster renameOutputWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -3514,16 +3712,17 @@ class AudioOutputSelectOutput : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPAudioOutputClusterSelectOutputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:mIndex]; [cluster selectOutputWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -4039,16 +4238,17 @@ class BarrierControlBarrierControlGoToPercent : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBarrierControlClusterBarrierControlGoToPercentParams alloc] init]; + params.percentOpen = [NSNumber numberWithUnsignedChar:mPercentOpen]; [cluster barrierControlGoToPercentWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -4072,13 +4272,13 @@ class BarrierControlBarrierControlStop : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster barrierControlStopWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -5178,7 +5378,7 @@ class WriteBasicNodeLabel : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000005) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() @@ -5186,11 +5386,11 @@ class WriteBasicNodeLabel : public ModelCommand { [cluster writeAttributeNodeLabelWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Basic NodeLabel Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Basic NodeLabel Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -5291,7 +5491,7 @@ class WriteBasicLocation : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000006) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() @@ -5299,11 +5499,11 @@ class WriteBasicLocation : public ModelCommand { [cluster writeAttributeLocationWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Basic Location Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Basic Location Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -6099,17 +6299,18 @@ class WriteBasicLocalConfigDisabled : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000010) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeLocalConfigDisabledWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Basic LocalConfigDisabled Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeLocalConfigDisabledWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Basic LocalConfigDisabled Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -6700,17 +6901,17 @@ class WriteBinaryInputBasicOutOfService : public ModelCommand { CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; [cluster writeAttributeOutOfServiceWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "BinaryInputBasic OutOfService Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "BinaryInputBasic OutOfService Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -6817,17 +7018,17 @@ class WriteBinaryInputBasicPresentValue : public ModelCommand { CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; [cluster writeAttributePresentValueWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "BinaryInputBasic PresentValue Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "BinaryInputBasic PresentValue Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -7338,6 +7539,72 @@ class ReadBindingBinding : public ModelCommand { } }; +class WriteBindingBinding : public ModelCommand { +public: + WriteBindingBinding() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "binding"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteBindingBinding() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000001E) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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; + + 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 + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Binding Binding Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + class SubscribeAttributeBindingBinding : public ModelCommand { public: SubscribeAttributeBindingBinding() @@ -8147,17 +8414,19 @@ class BridgedActionsDisableAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterDisableActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster disableActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8185,18 +8454,21 @@ class BridgedActionsDisableActionWithDuration : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterDisableActionWithDurationParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + params.duration = [NSNumber numberWithUnsignedInt:mDuration]; [cluster disableActionWithDurationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8224,17 +8496,19 @@ class BridgedActionsEnableAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterEnableActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster enableActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8262,18 +8536,21 @@ class BridgedActionsEnableActionWithDuration : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterEnableActionWithDurationParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + params.duration = [NSNumber numberWithUnsignedInt:mDuration]; [cluster enableActionWithDurationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8301,17 +8578,19 @@ class BridgedActionsInstantAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterInstantActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster instantActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8339,18 +8618,21 @@ class BridgedActionsInstantActionWithTransition : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterInstantActionWithTransitionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; [cluster instantActionWithTransitionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8378,17 +8660,19 @@ class BridgedActionsPauseAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterPauseActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster pauseActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8416,18 +8700,21 @@ class BridgedActionsPauseActionWithDuration : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterPauseActionWithDurationParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + params.duration = [NSNumber numberWithUnsignedInt:mDuration]; [cluster pauseActionWithDurationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8455,17 +8742,19 @@ class BridgedActionsResumeAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterResumeActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster resumeActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8492,17 +8781,19 @@ class BridgedActionsStartAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterStartActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster startActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8530,18 +8821,21 @@ class BridgedActionsStartActionWithDuration : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterStartActionWithDurationParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + params.duration = [NSNumber numberWithUnsignedInt:mDuration]; [cluster startActionWithDurationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -8569,17 +8863,19 @@ class BridgedActionsStopAction : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPBridgedActionsClusterStopActionParams alloc] init]; + params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; [cluster stopActionWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -9458,7 +9754,7 @@ class WriteBridgedDeviceBasicNodeLabel : public ModelCommand { CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() @@ -9466,11 +9762,11 @@ class WriteBridgedDeviceBasicNodeLabel : public ModelCommand { [cluster writeAttributeNodeLabelWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "BridgedDeviceBasic NodeLabel Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "BridgedDeviceBasic NodeLabel Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -10786,18 +11082,19 @@ class ChannelChangeChannel : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPChannelClusterChangeChannelParams alloc] init]; + params.match = [[NSString alloc] initWithBytes:mMatch.data() length:mMatch.size() encoding:NSUTF8StringEncoding]; [cluster changeChannelWithParams:params completionHandler:^(CHIPChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -10823,17 +11120,19 @@ class ChannelChangeChannelByNumber : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPChannelClusterChangeChannelByNumberParams alloc] init]; + params.majorNumber = [NSNumber numberWithUnsignedShort:mMajorNumber]; + params.minorNumber = [NSNumber numberWithUnsignedShort:mMinorNumber]; [cluster changeChannelByNumberWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -10859,16 +11158,17 @@ class ChannelSkipChannel : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPChannelClusterSkipChannelParams alloc] init]; + params.count = [NSNumber numberWithUnsignedShort:mCount]; [cluster skipChannelWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11529,22 +11829,29 @@ class ColorControlColorLoopSet : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; + 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]; [cluster colorLoopSetWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11578,19 +11885,23 @@ class ColorControlEnhancedMoveHue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedShort:mRate]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster enhancedMoveHueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11622,20 +11933,25 @@ class ColorControlEnhancedMoveToHue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; + 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]; [cluster enhancedMoveToHueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11668,20 +11984,25 @@ class ColorControlEnhancedMoveToHueAndSaturation : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueAndSaturationParams alloc] init]; + 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]; [cluster enhancedMoveToHueAndSaturationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11714,20 +12035,25 @@ class ColorControlEnhancedStepHue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterEnhancedStepHueParams alloc] init]; + 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]; [cluster enhancedStepHueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11759,19 +12085,23 @@ class ColorControlMoveColor : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; + params.rateX = [NSNumber numberWithShort:mRateX]; + params.rateY = [NSNumber numberWithShort:mRateY]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveColorWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11804,21 +12134,27 @@ class ColorControlMoveColorTemperature : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + 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]; [cluster moveColorTemperatureWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11851,19 +12187,23 @@ class ColorControlMoveHue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveHueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11894,19 +12234,23 @@ class ColorControlMoveSaturation : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveSaturationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11938,20 +12282,25 @@ class ColorControlMoveToColor : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init]; + 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]; [cluster moveToColorWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -11983,19 +12332,23 @@ class ColorControlMoveToColorTemperature : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init]; + params.colorTemperature = [NSNumber numberWithUnsignedShort:mColorTemperature]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveToColorTemperatureWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12027,20 +12380,25 @@ class ColorControlMoveToHue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; + params.hue = [NSNumber numberWithUnsignedChar:mHue]; + params.direction = [NSNumber numberWithUnsignedChar:mDirection]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveToHueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12073,20 +12431,25 @@ class ColorControlMoveToHueAndSaturation : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveToHueAndSaturationParams alloc] init]; + params.hue = [NSNumber numberWithUnsignedChar:mHue]; + params.saturation = [NSNumber numberWithUnsignedChar:mSaturation]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveToHueAndSaturationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12118,19 +12481,23 @@ class ColorControlMoveToSaturation : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; + params.saturation = [NSNumber numberWithUnsignedChar:mSaturation]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster moveToSaturationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12162,20 +12529,25 @@ class ColorControlStepColor : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterStepColorParams alloc] init]; + params.stepX = [NSNumber numberWithShort:mStepX]; + params.stepY = [NSNumber numberWithShort:mStepY]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster stepColorWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12210,22 +12582,29 @@ class ColorControlStepColorTemperature : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + 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]; [cluster stepColorTemperatureWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12260,20 +12639,25 @@ class ColorControlStepHue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; + 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]; [cluster stepHueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12306,20 +12690,25 @@ class ColorControlStepSaturation : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; + 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]; [cluster stepSaturationWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -12349,17 +12738,19 @@ class ColorControlStopMoveStep : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mOptionsMask]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mOptionsOverride]; [cluster stopMoveStepWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -13109,18 +13500,18 @@ class WriteColorControlColorControlOptions : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000000F) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeColorControlOptionsWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorControlOptions Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeColorControlOptionsWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorControlOptions Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -14685,17 +15076,17 @@ class WriteColorControlWhitePointX : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000030) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeWhitePointXWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl WhitePointX Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl WhitePointX Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -14796,17 +15187,17 @@ class WriteColorControlWhitePointY : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000031) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeWhitePointYWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl WhitePointY Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl WhitePointY Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -14907,17 +15298,17 @@ class WriteColorControlColorPointRX : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000032) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeColorPointRXWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorPointRX Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointRX Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15018,17 +15409,17 @@ class WriteColorControlColorPointRY : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000033) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeColorPointRYWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorPointRY Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointRY Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15129,18 +15520,18 @@ class WriteColorControlColorPointRIntensity : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000034) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeColorPointRIntensityWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "ColorControl ColorPointRIntensity Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointRIntensity Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15242,17 +15633,17 @@ class WriteColorControlColorPointGX : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000036) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeColorPointGXWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorPointGX Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointGX Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15353,17 +15744,17 @@ class WriteColorControlColorPointGY : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000037) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeColorPointGYWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorPointGY Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointGY Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15464,18 +15855,18 @@ class WriteColorControlColorPointGIntensity : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000038) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeColorPointGIntensityWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "ColorControl ColorPointGIntensity Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointGIntensity Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15577,17 +15968,17 @@ class WriteColorControlColorPointBX : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000003A) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeColorPointBXWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorPointBX Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointBX Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15688,17 +16079,17 @@ class WriteColorControlColorPointBY : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000003B) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeColorPointBYWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ColorControl ColorPointBY Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointBY Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -15799,18 +16190,18 @@ class WriteColorControlColorPointBIntensity : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000003C) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeColorPointBIntensityWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "ColorControl ColorPointBIntensity Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ColorControl ColorPointBIntensity Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -16775,19 +17166,19 @@ class WriteColorControlStartUpColorTemperatureMireds : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00004010) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "ColorControl StartUpColorTemperatureMireds Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -17178,7 +17569,9 @@ class ContentLauncherLaunchContent : public ModelCommand { public: ContentLauncherLaunchContent() : ModelCommand("launch-content") + , mComplex_Search(&mRequest.search) { + AddArgument("Search", &mComplex_Search); AddArgument("AutoPlay", 0, 1, &mAutoPlay); AddArgument("Data", &mData); ModelCommand::AddArguments(); @@ -17190,23 +17583,60 @@ class ContentLauncherLaunchContent : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPContentLauncherClusterLaunchContentParams alloc] init]; - // search Struct parsing is not supported yet + + params.search = [CHIPContentLauncherClusterContentSearch new]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.search.parameterList) { + CHIPContentLauncherClusterParameter * newElement_1; + newElement_1 = [CHIPContentLauncherClusterParameter new]; + newElement_1.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.type)]; + newElement_1.value = [[NSString alloc] initWithBytes:entry_1.value.data() + length:entry_1.value.size() + encoding:NSUTF8StringEncoding]; + if (entry_1.externalIDList.HasValue()) { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + for (auto & entry_4 : entry_1.externalIDList.Value()) { + CHIPContentLauncherClusterAdditionalInfo * newElement_4; + newElement_4 = [CHIPContentLauncherClusterAdditionalInfo new]; + newElement_4.name = [[NSString alloc] initWithBytes:entry_4.name.data() + length:entry_4.name.size() + encoding:NSUTF8StringEncoding]; + newElement_4.value = [[NSString alloc] initWithBytes:entry_4.value.data() + length:entry_4.value.size() + encoding:NSUTF8StringEncoding]; + [array_4 addObject:newElement_4]; + } + newElement_1.externalIDList = array_4; + } + } else { + newElement_1.externalIDList = nil; + } + [array_1 addObject:newElement_1]; + } + params.search.parameterList = array_1; + } + params.autoPlay = [NSNumber numberWithBool:mAutoPlay]; + params.data = [[NSString alloc] initWithBytes:mData.data() length:mData.size() encoding:NSUTF8StringEncoding]; [cluster launchContentWithParams:params completionHandler:^( CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type mRequest; + TypedComplexArgument mComplex_Search; bool mAutoPlay; chip::ByteSpan mData; }; @@ -17218,9 +17648,11 @@ class ContentLauncherLaunchURL : public ModelCommand { public: ContentLauncherLaunchURL() : ModelCommand("launch-url") + , mComplex_BrandingInformation(&mRequest.brandingInformation) { AddArgument("ContentURL", &mContentURL); AddArgument("DisplayString", &mDisplayString); + AddArgument("BrandingInformation", &mComplex_BrandingInformation); ModelCommand::AddArguments(); } @@ -17230,29 +17662,208 @@ class ContentLauncherLaunchURL : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = [[NSString alloc] initWithBytes:mContentURL.data() length:mContentURL.size() encoding:NSUTF8StringEncoding]; + params.displayString = [[NSString alloc] initWithBytes:mDisplayString.data() length:mDisplayString.size() encoding:NSUTF8StringEncoding]; - // brandingInformation Struct parsing is not supported yet + + if (mRequest.brandingInformation.HasValue()) { + params.brandingInformation = [CHIPContentLauncherClusterBrandingInformation new]; + params.brandingInformation.providerName = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().providerName.data() + length:mRequest.brandingInformation.Value().providerName.size() + encoding:NSUTF8StringEncoding]; + if (mRequest.brandingInformation.Value().background.HasValue()) { + params.brandingInformation.background = [CHIPContentLauncherClusterStyleInformation new]; + if (mRequest.brandingInformation.Value().background.Value().imageUrl.HasValue()) { + params.brandingInformation.background.imageUrl = [[NSString alloc] + initWithBytes:mRequest.brandingInformation.Value().background.Value().imageUrl.Value().data() + length:mRequest.brandingInformation.Value().background.Value().imageUrl.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.background.imageUrl = nil; + } + if (mRequest.brandingInformation.Value().background.Value().color.HasValue()) { + params.brandingInformation.background.color = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().background.Value().color.Value().data() + length:mRequest.brandingInformation.Value().background.Value().color.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.background.color = nil; + } + if (mRequest.brandingInformation.Value().background.Value().size.HasValue()) { + params.brandingInformation.background.size = [CHIPContentLauncherClusterDimension new]; + params.brandingInformation.background.size.width = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().background.Value().size.Value().width]; + params.brandingInformation.background.size.height = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().background.Value().size.Value().height]; + params.brandingInformation.background.size.metric = [NSNumber + numberWithUnsignedChar:chip::to_underlying( + mRequest.brandingInformation.Value().background.Value().size.Value().metric)]; + } else { + params.brandingInformation.background.size = nil; + } + } else { + params.brandingInformation.background = nil; + } + if (mRequest.brandingInformation.Value().logo.HasValue()) { + params.brandingInformation.logo = [CHIPContentLauncherClusterStyleInformation new]; + if (mRequest.brandingInformation.Value().logo.Value().imageUrl.HasValue()) { + params.brandingInformation.logo.imageUrl = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().logo.Value().imageUrl.Value().data() + length:mRequest.brandingInformation.Value().logo.Value().imageUrl.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.logo.imageUrl = nil; + } + if (mRequest.brandingInformation.Value().logo.Value().color.HasValue()) { + params.brandingInformation.logo.color = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().logo.Value().color.Value().data() + length:mRequest.brandingInformation.Value().logo.Value().color.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.logo.color = nil; + } + if (mRequest.brandingInformation.Value().logo.Value().size.HasValue()) { + params.brandingInformation.logo.size = [CHIPContentLauncherClusterDimension new]; + params.brandingInformation.logo.size.width = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().logo.Value().size.Value().width]; + params.brandingInformation.logo.size.height = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().logo.Value().size.Value().height]; + params.brandingInformation.logo.size.metric = [NSNumber + numberWithUnsignedChar:chip::to_underlying( + mRequest.brandingInformation.Value().logo.Value().size.Value().metric)]; + } else { + params.brandingInformation.logo.size = nil; + } + } else { + params.brandingInformation.logo = nil; + } + if (mRequest.brandingInformation.Value().progressBar.HasValue()) { + params.brandingInformation.progressBar = [CHIPContentLauncherClusterStyleInformation new]; + if (mRequest.brandingInformation.Value().progressBar.Value().imageUrl.HasValue()) { + params.brandingInformation.progressBar.imageUrl = [[NSString alloc] + initWithBytes:mRequest.brandingInformation.Value().progressBar.Value().imageUrl.Value().data() + length:mRequest.brandingInformation.Value().progressBar.Value().imageUrl.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.progressBar.imageUrl = nil; + } + if (mRequest.brandingInformation.Value().progressBar.Value().color.HasValue()) { + params.brandingInformation.progressBar.color = [[NSString alloc] + initWithBytes:mRequest.brandingInformation.Value().progressBar.Value().color.Value().data() + length:mRequest.brandingInformation.Value().progressBar.Value().color.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.progressBar.color = nil; + } + if (mRequest.brandingInformation.Value().progressBar.Value().size.HasValue()) { + params.brandingInformation.progressBar.size = [CHIPContentLauncherClusterDimension new]; + params.brandingInformation.progressBar.size.width = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().progressBar.Value().size.Value().width]; + params.brandingInformation.progressBar.size.height = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().progressBar.Value().size.Value().height]; + params.brandingInformation.progressBar.size.metric = [NSNumber + numberWithUnsignedChar:chip::to_underlying( + mRequest.brandingInformation.Value().progressBar.Value().size.Value().metric)]; + } else { + params.brandingInformation.progressBar.size = nil; + } + } else { + params.brandingInformation.progressBar = nil; + } + if (mRequest.brandingInformation.Value().splash.HasValue()) { + params.brandingInformation.splash = [CHIPContentLauncherClusterStyleInformation new]; + if (mRequest.brandingInformation.Value().splash.Value().imageUrl.HasValue()) { + params.brandingInformation.splash.imageUrl = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().splash.Value().imageUrl.Value().data() + length:mRequest.brandingInformation.Value().splash.Value().imageUrl.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.splash.imageUrl = nil; + } + if (mRequest.brandingInformation.Value().splash.Value().color.HasValue()) { + params.brandingInformation.splash.color = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().splash.Value().color.Value().data() + length:mRequest.brandingInformation.Value().splash.Value().color.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.splash.color = nil; + } + if (mRequest.brandingInformation.Value().splash.Value().size.HasValue()) { + params.brandingInformation.splash.size = [CHIPContentLauncherClusterDimension new]; + params.brandingInformation.splash.size.width = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().splash.Value().size.Value().width]; + params.brandingInformation.splash.size.height = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().splash.Value().size.Value().height]; + params.brandingInformation.splash.size.metric = [NSNumber + numberWithUnsignedChar:chip::to_underlying( + mRequest.brandingInformation.Value().splash.Value().size.Value().metric)]; + } else { + params.brandingInformation.splash.size = nil; + } + } else { + params.brandingInformation.splash = nil; + } + if (mRequest.brandingInformation.Value().waterMark.HasValue()) { + params.brandingInformation.waterMark = [CHIPContentLauncherClusterStyleInformation new]; + if (mRequest.brandingInformation.Value().waterMark.Value().imageUrl.HasValue()) { + params.brandingInformation.waterMark.imageUrl = [[NSString alloc] + initWithBytes:mRequest.brandingInformation.Value().waterMark.Value().imageUrl.Value().data() + length:mRequest.brandingInformation.Value().waterMark.Value().imageUrl.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.waterMark.imageUrl = nil; + } + if (mRequest.brandingInformation.Value().waterMark.Value().color.HasValue()) { + params.brandingInformation.waterMark.color = + [[NSString alloc] initWithBytes:mRequest.brandingInformation.Value().waterMark.Value().color.Value().data() + length:mRequest.brandingInformation.Value().waterMark.Value().color.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + params.brandingInformation.waterMark.color = nil; + } + if (mRequest.brandingInformation.Value().waterMark.Value().size.HasValue()) { + params.brandingInformation.waterMark.size = [CHIPContentLauncherClusterDimension new]; + params.brandingInformation.waterMark.size.width = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().waterMark.Value().size.Value().width]; + params.brandingInformation.waterMark.size.height = + [NSNumber numberWithDouble:mRequest.brandingInformation.Value().waterMark.Value().size.Value().height]; + params.brandingInformation.waterMark.size.metric = [NSNumber + numberWithUnsignedChar:chip::to_underlying( + mRequest.brandingInformation.Value().waterMark.Value().size.Value().metric)]; + } else { + params.brandingInformation.waterMark.size = nil; + } + } else { + params.brandingInformation.waterMark = nil; + } + } else { + params.brandingInformation = nil; + } [cluster launchURLWithParams:params completionHandler:^(CHIPContentLauncherClusterLaunchResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: chip::ByteSpan mContentURL; chip::ByteSpan mDisplayString; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type mRequest; + TypedComplexArgument> + mComplex_BrandingInformation; }; /* @@ -17382,19 +17993,19 @@ class WriteContentLauncherSupportedStreamingProtocols : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050A) WriteAttribute (0x00000001) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeSupportedStreamingProtocolsWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "ContentLauncher SupportedStreamingProtocols Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -18431,21 +19042,24 @@ class DiagnosticLogsRetrieveLogsRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDiagnosticLogsClusterRetrieveLogsRequestParams alloc] init]; + params.intent = [NSNumber numberWithUnsignedChar:mIntent]; + params.requestedProtocol = [NSNumber numberWithUnsignedChar:mRequestedProtocol]; + params.transferFileDesignator = [[NSData alloc] initWithBytes:mTransferFileDesignator.data() length:mTransferFileDesignator.size()]; [cluster retrieveLogsRequestWithParams:params completionHandler:^(CHIPDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -18790,7 +19404,9 @@ class DoorLockClearCredential : public ModelCommand { public: DoorLockClearCredential() : ModelCommand("clear-credential") + , mComplex_Credential(&mRequest.credential) { + AddArgument("Credential", &mComplex_Credential); ModelCommand::AddArguments(); } @@ -18800,19 +19416,30 @@ class DoorLockClearCredential : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; - // credential Struct parsing is not supported yet + + 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]; + } [cluster clearCredentialWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type mRequest; + TypedComplexArgument> + mComplex_Credential; }; /* @@ -18833,16 +19460,17 @@ class DoorLockClearUser : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; [cluster clearUserWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -18868,17 +19496,19 @@ class DoorLockClearWeekDaySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; [cluster clearWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -18905,17 +19535,19 @@ class DoorLockClearYearDaySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterClearYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; [cluster clearYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -18930,7 +19562,9 @@ class DoorLockGetCredentialStatus : public ModelCommand { public: DoorLockGetCredentialStatus() : ModelCommand("get-credential-status") + , mComplex_Credential(&mRequest.credential) { + AddArgument("Credential", &mComplex_Credential); ModelCommand::AddArguments(); } @@ -18940,21 +19574,27 @@ class DoorLockGetCredentialStatus : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterGetCredentialStatusParams alloc] init]; - // credential Struct parsing is not supported yet + + params.credential = [CHIPDoorLockClusterDlCredential new]; + params.credential.credentialType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.credential.credentialType)]; + params.credential.credentialIndex = [NSNumber numberWithUnsignedShort:mRequest.credential.credentialIndex]; [cluster getCredentialStatusWithParams:params completionHandler:^(CHIPDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type mRequest; + TypedComplexArgument mComplex_Credential; }; /* @@ -18975,17 +19615,18 @@ class DoorLockGetUser : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterGetUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; [cluster getUserWithParams:params completionHandler:^(CHIPDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19011,19 +19652,21 @@ class DoorLockGetWeekDaySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:mWeekDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19050,19 +19693,21 @@ class DoorLockGetYearDaySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; [cluster getYearDayScheduleWithParams:params completionHandler:^( CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19088,16 +19733,17 @@ class DoorLockLockDoor : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; [cluster lockDoorWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19111,8 +19757,10 @@ class DoorLockSetCredential : public ModelCommand { public: DoorLockSetCredential() : ModelCommand("set-credential") + , mComplex_Credential(&mRequest.credential) { 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); @@ -19126,27 +19774,38 @@ class DoorLockSetCredential : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:mOperationType]; - // credential Struct parsing is not supported yet + + 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]; [cluster setCredentialWithParams:params completionHandler:^( CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: uint8_t mOperationType; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type mRequest; + TypedComplexArgument mComplex_Credential; chip::ByteSpan mCredentialData; uint16_t mUserIndex; uint8_t mUserStatus; @@ -19177,22 +19836,29 @@ class DoorLockSetUser : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterSetUserParams alloc] init]; + 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]; [cluster setUserWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19229,22 +19895,29 @@ class DoorLockSetWeekDaySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterSetWeekDayScheduleParams alloc] init]; + 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]; [cluster setWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19278,19 +19951,23 @@ class DoorLockSetYearDaySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:mYearDayIndex]; + params.userIndex = [NSNumber numberWithUnsignedShort:mUserIndex]; + params.localStartTime = [NSNumber numberWithUnsignedInt:mLocalStartTime]; + params.localEndTime = [NSNumber numberWithUnsignedInt:mLocalEndTime]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19318,16 +19995,17 @@ class DoorLockUnlockDoor : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; [cluster unlockDoorWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -19353,17 +20031,19 @@ class DoorLockUnlockWithTimeout : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPDoorLockClusterUnlockWithTimeoutParams alloc] init]; + params.timeout = [NSNumber numberWithUnsignedShort:mTimeout]; + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; [cluster unlockWithTimeoutWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -20444,7 +21124,7 @@ class WriteDoorLockLanguage : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000021) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() @@ -20452,11 +21132,11 @@ class WriteDoorLockLanguage : public ModelCommand { [cluster writeAttributeLanguageWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "DoorLock Language Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "DoorLock Language Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -20557,17 +21237,17 @@ class WriteDoorLockAutoRelockTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000023) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeAutoRelockTimeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "DoorLock AutoRelockTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "DoorLock AutoRelockTime Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -20668,17 +21348,17 @@ class WriteDoorLockSoundVolume : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000024) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeSoundVolumeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "DoorLock SoundVolume Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "DoorLock SoundVolume Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -20779,17 +21459,17 @@ class WriteDoorLockOperatingMode : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000025) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeOperatingModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "DoorLock OperatingMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "DoorLock OperatingMode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -20969,18 +21649,18 @@ class WriteDoorLockEnableOneTouchLocking : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000029) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster - writeAttributeEnableOneTouchLockingWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "DoorLock EnableOneTouchLocking Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeEnableOneTouchLockingWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "DoorLock EnableOneTouchLocking Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -21083,18 +21763,18 @@ class WriteDoorLockEnablePrivacyModeButton : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x0000002B) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; [cluster writeAttributeEnablePrivacyModeButtonWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "DoorLock EnablePrivacyModeButton Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "DoorLock EnablePrivacyModeButton Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -21196,17 +21876,18 @@ class WriteDoorLockWrongCodeEntryLimit : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000030) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeWrongCodeEntryLimitWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "DoorLock WrongCodeEntryLimit Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "DoorLock WrongCodeEntryLimit Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -22983,13 +23664,13 @@ class EthernetNetworkDiagnosticsResetCounts : public ModelCommand { CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -24205,17 +24886,17 @@ class WriteFanControlFanMode : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeFanModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "FanControl FanMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "FanControl FanMode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -24316,17 +24997,17 @@ class WriteFanControlFanModeSequence : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000202) WriteAttribute (0x00000001) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeFanModeSequenceWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "FanControl FanModeSequence Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "FanControl FanModeSequence Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -25851,20 +26532,23 @@ class GeneralCommissioningArmFailSafe : public ModelCommand { CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGeneralCommissioningClusterArmFailSafeParams alloc] init]; + params.expiryLengthSeconds = [NSNumber numberWithUnsignedShort:mExpiryLengthSeconds]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + params.timeoutMs = [NSNumber numberWithUnsignedInt:mTimeoutMs]; [cluster armFailSafeWithParams:params completionHandler:^( CHIPGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -25892,15 +26576,15 @@ class GeneralCommissioningCommissioningComplete : public ModelCommand { CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster commissioningCompleteWithCompletionHandler:^( CHIPGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -25929,24 +26613,28 @@ class GeneralCommissioningSetRegulatoryConfig : public ModelCommand { CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGeneralCommissioningClusterSetRegulatoryConfigParams alloc] init]; + params.location = [NSNumber numberWithUnsignedChar:mLocation]; + params.countryCode = [[NSString alloc] initWithBytes:mCountryCode.data() length:mCountryCode.size() encoding:NSUTF8StringEncoding]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + params.timeoutMs = [NSNumber numberWithUnsignedInt:mTimeoutMs]; [cluster setRegulatoryConfigWithParams:params completionHandler:^(CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -26009,17 +26697,17 @@ class WriteGeneralCommissioningBreadcrumb : public ModelCommand { CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeBreadcrumbWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "GeneralCommissioning Breadcrumb Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "GeneralCommissioning Breadcrumb Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -27700,18 +28388,19 @@ class GroupKeyManagementKeySetRead : public ModelCommand { CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:mGroupKeySetID]; [cluster keySetReadWithParams:params completionHandler:^( CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -27725,7 +28414,9 @@ class GroupKeyManagementKeySetReadAllIndices : public ModelCommand { public: GroupKeyManagementKeySetReadAllIndices() : ModelCommand("key-set-read-all-indices") + , mComplex_GroupKeySetIDs(&mRequest.groupKeySetIDs) { + AddArgument("GroupKeySetIDs", &mComplex_GroupKeySetIDs); ModelCommand::AddArguments(); } @@ -27737,22 +28428,33 @@ class GroupKeyManagementKeySetReadAllIndices : public ModelCommand { CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams alloc] init]; - // GroupKeySetIDs Array parsing is not supported yet + + { // 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; + } [cluster keySetReadAllIndicesWithParams:params completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type mRequest; + TypedComplexArgument> mComplex_GroupKeySetIDs; }; /* @@ -27775,16 +28477,17 @@ class GroupKeyManagementKeySetRemove : public ModelCommand { CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:mGroupKeySetID]; [cluster keySetRemoveWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -27798,7 +28501,9 @@ class GroupKeyManagementKeySetWrite : public ModelCommand { public: GroupKeyManagementKeySetWrite() : ModelCommand("key-set-write") + , mComplex_GroupKeySet(&mRequest.groupKeySet) { + AddArgument("GroupKeySet", &mComplex_GroupKeySet); ModelCommand::AddArguments(); } @@ -27810,19 +28515,58 @@ class GroupKeyManagementKeySetWrite : public ModelCommand { CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; - // GroupKeySet Struct parsing is not supported yet + + 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()]; + } [cluster keySetWriteWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; + TypedComplexArgument mComplex_GroupKeySet; }; /* @@ -27861,6 +28605,58 @@ class ReadGroupKeyManagementGroupKeyMap : public ModelCommand { } }; +class WriteGroupKeyManagementGroupKeyMap : public ModelCommand { +public: + WriteGroupKeyManagementGroupKeyMap() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "group-key-map"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteGroupKeyManagementGroupKeyMap() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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; + + 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 + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "GroupKeyManagement GroupKeyMap Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; +}; + class SubscribeAttributeGroupKeyManagementGroupKeyMap : public ModelCommand { public: SubscribeAttributeGroupKeyManagementGroupKeyMap() @@ -28523,20 +29319,22 @@ class GroupsAddGroup : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.groupName = [[NSString alloc] initWithBytes:mGroupName.data() length:mGroupName.size() encoding:NSUTF8StringEncoding]; [cluster addGroupWithParams:params completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -28563,19 +29361,21 @@ class GroupsAddGroupIfIdentifying : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupsClusterAddGroupIfIdentifyingParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.groupName = [[NSString alloc] initWithBytes:mGroupName.data() length:mGroupName.size() encoding:NSUTF8StringEncoding]; [cluster addGroupIfIdentifyingWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -28590,7 +29390,9 @@ class GroupsGetGroupMembership : public ModelCommand { public: GroupsGetGroupMembership() : ModelCommand("get-group-membership") + , mComplex_GroupList(&mRequest.groupList) { + AddArgument("GroupList", &mComplex_GroupList); ModelCommand::AddArguments(); } @@ -28600,21 +29402,32 @@ class GroupsGetGroupMembership : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - // groupList Array parsing is not supported yet + + { // 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; + } [cluster getGroupMembershipWithParams:params completionHandler:^( CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type mRequest; + TypedComplexArgument> mComplex_GroupList; }; /* @@ -28634,13 +29447,13 @@ class GroupsRemoveAllGroups : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -28664,17 +29477,18 @@ class GroupsRemoveGroup : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; [cluster removeGroupWithParams:params completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -28699,17 +29513,18 @@ class GroupsViewGroup : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; [cluster viewGroupWithParams:params completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -29139,16 +29954,17 @@ class IdentifyIdentify : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:mIdentifyTime]; [cluster identifyWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -29172,15 +29988,15 @@ class IdentifyIdentifyQuery : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster identifyQueryWithCompletionHandler:^( CHIPIdentifyClusterIdentifyQueryResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -29205,17 +30021,19 @@ class IdentifyTriggerEffect : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPIdentifyClusterTriggerEffectParams alloc] init]; + params.effectIdentifier = [NSNumber numberWithUnsignedChar:mEffectIdentifier]; + params.effectVariant = [NSNumber numberWithUnsignedChar:mEffectVariant]; [cluster triggerEffectWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -29272,17 +30090,17 @@ class WriteIdentifyIdentifyTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000003) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeIdentifyTimeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Identify IdentifyTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Identify IdentifyTime Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -30511,17 +31329,18 @@ class KeypadInputSendKey : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPKeypadInputClusterSendKeyParams alloc] init]; + params.keyCode = [NSNumber numberWithUnsignedChar:mKeyCode]; [cluster sendKeyWithParams:params completionHandler:^(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -30896,19 +31715,23 @@ class LevelControlMove : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterMoveParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; [cluster moveWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -30939,19 +31762,23 @@ class LevelControlMoveToLevel : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterMoveToLevelParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:mLevel]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; [cluster moveToLevelWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -30980,17 +31807,19 @@ class LevelControlMoveToLevelWithOnOff : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; + params.level = [NSNumber numberWithUnsignedChar:mLevel]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; [cluster moveToLevelWithOnOffWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31017,17 +31846,19 @@ class LevelControlMoveWithOnOff : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterMoveWithOnOffParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:mMoveMode]; + params.rate = [NSNumber numberWithUnsignedChar:mRate]; [cluster moveWithOnOffWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31057,20 +31888,25 @@ class LevelControlStep : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterStepParams alloc] init]; + 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]; [cluster stepWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31101,18 +31937,21 @@ class LevelControlStepWithOnOff : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterStepWithOnOffParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:mStepMode]; + params.stepSize = [NSNumber numberWithUnsignedChar:mStepSize]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; [cluster stepWithOnOffWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31140,17 +31979,19 @@ class LevelControlStop : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPLevelControlClusterStopParams alloc] init]; + params.optionMask = [NSNumber numberWithUnsignedChar:mOptionMask]; + params.optionOverride = [NSNumber numberWithUnsignedChar:mOptionOverride]; [cluster stopWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31175,13 +32016,13 @@ class LevelControlStopWithOnOff : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster stopWithOnOffWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31775,17 +32616,17 @@ class WriteLevelControlOptions : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x0000000F) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeOptionsWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl Options Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "LevelControl Options Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -31886,18 +32727,18 @@ class WriteLevelControlOnOffTransitionTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000010) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster - writeAttributeOnOffTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl OnOffTransitionTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeOnOffTransitionTimeWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "LevelControl OnOffTransitionTime Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -31999,17 +32840,17 @@ class WriteLevelControlOnLevel : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000011) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeOnLevelWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl OnLevel Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "LevelControl OnLevel Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -32110,17 +32951,18 @@ class WriteLevelControlOnTransitionTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000012) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeOnTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl OnTransitionTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeOnTransitionTimeWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "LevelControl OnTransitionTime Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -32221,17 +33063,18 @@ class WriteLevelControlOffTransitionTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000013) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeOffTransitionTimeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl OffTransitionTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "LevelControl OffTransitionTime Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -32332,17 +33175,18 @@ class WriteLevelControlDefaultMoveRate : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000014) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeDefaultMoveRateWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl DefaultMoveRate Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeDefaultMoveRateWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "LevelControl DefaultMoveRate Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -32443,18 +33287,18 @@ class WriteLevelControlStartUpCurrentLevel : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00004000) on endpoint %" PRIu16, 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeStartUpCurrentLevelWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LevelControl StartUpCurrentLevel Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeStartUpCurrentLevelWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "LevelControl StartUpCurrentLevel Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -32964,20 +33808,20 @@ class WriteLocalizationConfigurationActiveLocale : public ModelCommand { CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; - [cluster - writeAttributeActiveLocaleWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "LocalizationConfiguration ActiveLocale Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeActiveLocaleWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "LocalizationConfiguration ActiveLocale Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -33393,13 +34237,13 @@ class LowPowerSleep : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster sleepWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -33752,13 +34596,13 @@ class MediaInputHideInputStatus : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster hideInputStatusWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -33783,17 +34627,19 @@ class MediaInputRenameInput : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPMediaInputClusterRenameInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:mIndex]; + params.name = [[NSString alloc] initWithBytes:mName.data() length:mName.size() encoding:NSUTF8StringEncoding]; [cluster renameInputWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -33819,16 +34665,17 @@ class MediaInputSelectInput : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPMediaInputClusterSelectInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:mIndex]; [cluster selectInputWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -33852,13 +34699,13 @@ class MediaInputShowInputStatus : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster showInputStatusWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34378,15 +35225,15 @@ class MediaPlaybackFastForward : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster fastForwardWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34409,15 +35256,15 @@ class MediaPlaybackNext : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster nextWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34440,15 +35287,15 @@ class MediaPlaybackPause : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster pauseWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34471,15 +35318,15 @@ class MediaPlaybackPlay : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster playWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34502,15 +35349,15 @@ class MediaPlaybackPrevious : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster previousWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34533,15 +35380,15 @@ class MediaPlaybackRewind : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster rewindWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34565,17 +35412,18 @@ class MediaPlaybackSeek : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPMediaPlaybackClusterSeekParams alloc] init]; + params.position = [NSNumber numberWithUnsignedLongLong:mPosition]; [cluster seekWithParams:params completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34600,18 +35448,19 @@ class MediaPlaybackSkipBackward : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPMediaPlaybackClusterSkipBackwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:mDeltaPositionMilliseconds]; [cluster skipBackwardWithParams:params completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34636,18 +35485,19 @@ class MediaPlaybackSkipForward : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPMediaPlaybackClusterSkipForwardParams alloc] init]; + params.deltaPositionMilliseconds = [NSNumber numberWithUnsignedLongLong:mDeltaPositionMilliseconds]; [cluster skipForwardWithParams:params completionHandler:^(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34671,15 +35521,15 @@ class MediaPlaybackStartOver : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster startOverWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -34702,15 +35552,15 @@ class MediaPlaybackStopPlayback : public ModelCommand { 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 err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster stopPlaybackWithCompletionHandler:^( CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -35607,16 +36457,17 @@ class ModeSelectChangeToMode : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPModeSelectClusterChangeToModeParams alloc] init]; + params.newMode = [NSNumber numberWithUnsignedChar:mNewMode]; [cluster changeToModeWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -35980,17 +36831,17 @@ class WriteModeSelectStartUpMode : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000004) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeStartUpModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect StartUpMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ModeSelect StartUpMode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36091,17 +36942,17 @@ class WriteModeSelectOnMode : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000005) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeOnModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "ModeSelect OnMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "ModeSelect OnMode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36590,19 +37441,21 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkParams alloc] init]; + params.operationalDataset = [[NSData alloc] initWithBytes:mOperationalDataset.data() length:mOperationalDataset.size()]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; [cluster addOrUpdateThreadNetworkWithParams:params completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36632,20 +37485,23 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams alloc] init]; + params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; + params.credentials = [[NSData alloc] initWithBytes:mCredentials.data() length:mCredentials.size()]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; [cluster addOrUpdateWiFiNetworkWithParams:params completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36675,19 +37531,21 @@ class NetworkCommissioningConnectNetwork : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPNetworkCommissioningClusterConnectNetworkParams alloc] init]; + params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; [cluster connectNetworkWithParams:params completionHandler:^(CHIPNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36716,19 +37574,21 @@ class NetworkCommissioningRemoveNetwork : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPNetworkCommissioningClusterRemoveNetworkParams alloc] init]; + params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; [cluster removeNetworkWithParams:params completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36758,20 +37618,23 @@ class NetworkCommissioningReorderNetwork : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPNetworkCommissioningClusterReorderNetworkParams alloc] init]; + params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; + params.networkIndex = [NSNumber numberWithUnsignedChar:mNetworkIndex]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; [cluster reorderNetworkWithParams:params completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -36801,19 +37664,21 @@ class NetworkCommissioningScanNetworks : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPNetworkCommissioningClusterScanNetworksParams alloc] init]; + params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; [cluster scanNetworksWithParams:params completionHandler:^( CHIPNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -37200,18 +38065,18 @@ class WriteNetworkCommissioningInterfaceEnabled : public ModelCommand { CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; [cluster writeAttributeInterfaceEnabledWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "NetworkCommissioning InterfaceEnabled Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "NetworkCommissioning InterfaceEnabled Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -37877,19 +38742,21 @@ class OtaSoftwareUpdateProviderApplyUpdateRequest : public ModelCommand { CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams alloc] init]; + params.updateToken = [[NSData alloc] initWithBytes:mUpdateToken.data() length:mUpdateToken.size()]; + params.newVersion = [NSNumber numberWithUnsignedInt:mNewVersion]; [cluster applyUpdateRequestWithParams:params completionHandler:^(CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -37918,17 +38785,19 @@ class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ModelCommand { CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams alloc] init]; + params.updateToken = [[NSData alloc] initWithBytes:mUpdateToken.data() length:mUpdateToken.size()]; + params.softwareVersion = [NSNumber numberWithUnsignedInt:mSoftwareVersion]; [cluster notifyUpdateAppliedWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -37943,10 +38812,12 @@ class OtaSoftwareUpdateProviderQueryImage : public ModelCommand { public: OtaSoftwareUpdateProviderQueryImage() : ModelCommand("query-image") + , mComplex_ProtocolsSupported(&mRequest.protocolsSupported) { 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); @@ -37962,31 +38833,50 @@ class OtaSoftwareUpdateProviderQueryImage : public ModelCommand { CHIPOtaSoftwareUpdateProvider * cluster = [[CHIPOtaSoftwareUpdateProvider alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOtaSoftwareUpdateProviderClusterQueryImageParams alloc] init]; + params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; + params.productId = [NSNumber numberWithUnsignedShort:mProductId]; + params.softwareVersion = [NSNumber numberWithUnsignedInt:mSoftwareVersion]; - // protocolsSupported Array parsing is not supported yet + + { // 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; + } + params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion]; + params.location = [[NSString alloc] initWithBytes:mLocation.data() length:mLocation.size() encoding:NSUTF8StringEncoding]; + params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent]; + params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.data() length:mMetadataForProvider.size()]; [cluster queryImageWithParams:params completionHandler:^(CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: chip::VendorId mVendorId; uint16_t mProductId; uint32_t mSoftwareVersion; + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type mRequest; + TypedComplexArgument> + mComplex_ProtocolsSupported; uint16_t mHardwareVersion; chip::ByteSpan mLocation; bool mRequestorCanConsent; @@ -38204,20 +39094,25 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ModelCommand { CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams alloc] init]; + params.providerNodeId = [NSNumber numberWithUnsignedLongLong:mProviderNodeId]; + params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; + params.announcementReason = [NSNumber numberWithUnsignedChar:mAnnouncementReason]; + params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.data() length:mMetadataForNode.size()]; + params.endpoint = [NSNumber numberWithUnsignedShort:mEndpoint]; [cluster announceOtaProviderWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -38266,6 +39161,59 @@ class ReadOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand { } }; +class WriteOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand { +public: + WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "default-ota-providers"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002A) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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; + + 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 + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; +}; + class SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand { public: SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOtaProviders() @@ -39367,13 +40315,13 @@ class OnOffOff : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster offWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39398,17 +40346,19 @@ class OnOffOffWithEffect : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOnOffClusterOffWithEffectParams alloc] init]; + params.effectId = [NSNumber numberWithUnsignedChar:mEffectId]; + params.effectVariant = [NSNumber numberWithUnsignedChar:mEffectVariant]; [cluster offWithEffectWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39433,13 +40383,13 @@ class OnOffOn : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster onWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39462,13 +40412,13 @@ class OnOffOnWithRecallGlobalScene : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster onWithRecallGlobalSceneWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39494,18 +40444,21 @@ class OnOffOnWithTimedOff : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOnOffClusterOnWithTimedOffParams alloc] init]; + params.onOffControl = [NSNumber numberWithUnsignedChar:mOnOffControl]; + params.onTime = [NSNumber numberWithUnsignedShort:mOnTime]; + params.offWaitTime = [NSNumber numberWithUnsignedShort:mOffWaitTime]; [cluster onWithTimedOffWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39531,13 +40484,13 @@ class OnOffToggle : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster toggleWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39746,17 +40699,17 @@ class WriteOnOffOnTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004001) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeOnTimeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "OnOff OnTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "OnOff OnTime Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39857,17 +40810,17 @@ class WriteOnOffOffWaitTime : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004002) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeOffWaitTimeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "OnOff OffWaitTime Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "OnOff OffWaitTime Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -39968,17 +40921,17 @@ class WriteOnOffStartUpOnOff : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004003) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeStartUpOnOffWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "OnOff StartUpOnOff Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "OnOff StartUpOnOff Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -40566,18 +41519,18 @@ class WriteOnOffSwitchConfigurationSwitchActions : public ModelCommand { CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeSwitchActionsWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchActions Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeSwitchActionsWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "OnOffSwitchConfiguration SwitchActions Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -41014,22 +41967,27 @@ class OperationalCredentialsAddNOC : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterAddNOCParams alloc] init]; + params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.data() length:mICACValue.size()]; + params.ipkValue = [[NSData alloc] initWithBytes:mIPKValue.data() length:mIPKValue.size()]; + params.caseAdminNode = [NSNumber numberWithUnsignedLongLong:mCaseAdminNode]; + params.adminVendorId = [NSNumber numberWithUnsignedShort:mAdminVendorId]; [cluster addNOCWithParams:params completionHandler:^(CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41060,16 +42018,17 @@ class OperationalCredentialsAddTrustedRootCertificate : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterAddTrustedRootCertificateParams alloc] init]; + params.rootCertificate = [[NSData alloc] initWithBytes:mRootCertificate.data() length:mRootCertificate.size()]; [cluster addTrustedRootCertificateWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41096,18 +42055,19 @@ class OperationalCredentialsAttestationRequest : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterAttestationRequestParams alloc] init]; + params.attestationNonce = [[NSData alloc] initWithBytes:mAttestationNonce.data() length:mAttestationNonce.size()]; [cluster attestationRequestWithParams:params completionHandler:^(CHIPOperationalCredentialsClusterAttestationResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41134,18 +42094,19 @@ class OperationalCredentialsCSRRequest : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterCSRRequestParams alloc] init]; + params.csrNonce = [[NSData alloc] initWithBytes:mCSRNonce.data() length:mCSRNonce.size()]; [cluster CSRRequestWithParams:params completionHandler:^( CHIPOperationalCredentialsClusterCSRResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41172,19 +42133,20 @@ class OperationalCredentialsCertificateChainRequest : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterCertificateChainRequestParams alloc] init]; + params.certificateType = [NSNumber numberWithUnsignedChar:mCertificateType]; [cluster certificateChainRequestWithParams:params completionHandler:^(CHIPOperationalCredentialsClusterCertificateChainResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41211,18 +42173,19 @@ class OperationalCredentialsRemoveFabric : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [NSNumber numberWithUnsignedChar:mFabricIndex]; [cluster removeFabricWithParams:params completionHandler:^( CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41249,17 +42212,18 @@ class OperationalCredentialsRemoveTrustedRootCertificate : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterRemoveTrustedRootCertificateParams alloc] init]; + params.trustedRootIdentifier = [[NSData alloc] initWithBytes:mTrustedRootIdentifier.data() length:mTrustedRootIdentifier.size()]; [cluster removeTrustedRootCertificateWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41286,18 +42250,19 @@ class OperationalCredentialsUpdateFabricLabel : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateFabricLabelParams alloc] init]; + params.label = [[NSString alloc] initWithBytes:mLabel.data() length:mLabel.size() encoding:NSUTF8StringEncoding]; [cluster updateFabricLabelWithParams:params completionHandler:^( CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -41325,19 +42290,21 @@ class OperationalCredentialsUpdateNOC : public ModelCommand { CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPOperationalCredentialsClusterUpdateNOCParams alloc] init]; + params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.data() length:mICACValue.size()]; [cluster updateNOCWithParams:params completionHandler:^( CHIPOperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -45738,18 +46705,18 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public ModelCommand CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeLifetimeRunningHoursWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "PumpConfigurationAndControl LifetimeRunningHours Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -45938,19 +46905,19 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public ModelComma CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeLifetimeEnergyConsumedWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "PumpConfigurationAndControl LifetimeEnergyConsumed Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -46059,18 +47026,18 @@ class WritePumpConfigurationAndControlOperationMode : public ModelCommand { CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeOperationModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "PumpConfigurationAndControl OperationMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "PumpConfigurationAndControl OperationMode Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -46178,18 +47145,18 @@ class WritePumpConfigurationAndControlControlMode : public ModelCommand { CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeControlModeWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "PumpConfigurationAndControl ControlMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeControlModeWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "PumpConfigurationAndControl ControlMode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -47447,11 +48414,13 @@ class ScenesAddScene : public ModelCommand { public: ScenesAddScene() : ModelCommand("add-scene") + , mComplex_ExtensionFieldSets(&mRequest.extensionFieldSets) { 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); ModelCommand::AddArguments(); } @@ -47461,23 +48430,39 @@ class ScenesAddScene : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterAddSceneParams alloc] init]; + 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]; - // extensionFieldSets Array parsing is not supported yet + + { // 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; + } [cluster addSceneWithParams:params completionHandler:^(CHIPScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -47485,6 +48470,9 @@ class ScenesAddScene : public ModelCommand { uint8_t mSceneId; uint16_t mTransitionTime; chip::ByteSpan mSceneName; + chip::app::Clusters::Scenes::Commands::AddScene::Type mRequest; + TypedComplexArgument> + mComplex_ExtensionFieldSets; }; /* @@ -47505,18 +48493,19 @@ class ScenesGetSceneMembership : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterGetSceneMembershipParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; [cluster getSceneMembershipWithParams:params completionHandler:^( CHIPScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -47543,18 +48532,21 @@ class ScenesRecallScene : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterRecallSceneParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; + params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; [cluster recallSceneWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -47581,18 +48573,19 @@ class ScenesRemoveAllScenes : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterRemoveAllScenesParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; [cluster removeAllScenesWithParams:params completionHandler:^( CHIPScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -47618,18 +48611,20 @@ class ScenesRemoveScene : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterRemoveSceneParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; [cluster removeSceneWithParams:params completionHandler:^(CHIPScenesClusterRemoveSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -47656,18 +48651,20 @@ class ScenesStoreScene : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterStoreSceneParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; [cluster storeSceneWithParams:params completionHandler:^(CHIPScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -47694,18 +48691,20 @@ class ScenesViewScene : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPScenesClusterViewSceneParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:mGroupId]; + params.sceneId = [NSNumber numberWithUnsignedChar:mSceneId]; [cluster viewSceneWithParams:params completionHandler:^(CHIPScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -48446,13 +49445,13 @@ class SoftwareDiagnosticsResetWatermarks : public ModelCommand { CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster resetWatermarksWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -49873,19 +50872,21 @@ class TargetNavigatorNavigateTarget : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTargetNavigatorClusterNavigateTargetParams alloc] init]; + params.target = [NSNumber numberWithUnsignedChar:mTarget]; + params.data = [[NSString alloc] initWithBytes:mData.data() length:mData.size() encoding:NSUTF8StringEncoding]; [cluster navigateTargetWithParams:params completionHandler:^( CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -50994,7 +51995,9 @@ class TestClusterSimpleStructEchoRequest : public ModelCommand { public: TestClusterSimpleStructEchoRequest() : ModelCommand("simple-struct-echo-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51004,21 +52007,34 @@ class TestClusterSimpleStructEchoRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterSimpleStructEchoRequestParams alloc] init]; - // arg1 Struct parsing is not supported yet + + 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]; [cluster simpleStructEchoRequestWithParams:params completionHandler:^(CHIPTestClusterClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; }; /* @@ -51038,13 +52054,13 @@ class TestClusterTest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster testWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51069,19 +52085,21 @@ class TestClusterTestAddArguments : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestAddArgumentsParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; [cluster testAddArgumentsWithParams:params completionHandler:^( CHIPTestClusterClusterTestAddArgumentsResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51109,20 +52127,23 @@ class TestClusterTestEmitTestEventRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestEmitTestEventRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; + params.arg3 = [NSNumber numberWithBool:mArg3]; [cluster testEmitTestEventRequestWithParams:params completionHandler:^(CHIPTestClusterClusterTestEmitTestEventResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51150,19 +52171,21 @@ class TestClusterTestEnumsRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestEnumsRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedShort:mArg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mArg2]; [cluster testEnumsRequestWithParams:params completionHandler:^( CHIPTestClusterClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51177,7 +52200,9 @@ class TestClusterTestListInt8UArgumentRequest : public ModelCommand { public: TestClusterTestListInt8UArgumentRequest() : ModelCommand("test-list-int8uargument-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51187,21 +52212,32 @@ class TestClusterTestListInt8UArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestListInt8UArgumentRequestParams alloc] init]; - // arg1 Array parsing is not supported yet + + { // 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; + } [cluster testListInt8UArgumentRequestWithParams:params completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type mRequest; + TypedComplexArgument> mComplex_Arg1; }; /* @@ -51211,7 +52247,9 @@ class TestClusterTestListInt8UReverseRequest : public ModelCommand { public: TestClusterTestListInt8UReverseRequest() : ModelCommand("test-list-int8ureverse-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51221,22 +52259,33 @@ class TestClusterTestListInt8UReverseRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestListInt8UReverseRequestParams alloc] init]; - // arg1 Array parsing is not supported yet + + { // 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; + } [cluster testListInt8UReverseRequestWithParams:params completionHandler:^(CHIPTestClusterClusterTestListInt8UReverseResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type mRequest; + TypedComplexArgument> mComplex_Arg1; }; /* @@ -51246,7 +52295,9 @@ class TestClusterTestListNestedStructListArgumentRequest : public ModelCommand { public: TestClusterTestListNestedStructListArgumentRequest() : ModelCommand("test-list-nested-struct-list-argument-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51256,21 +52307,92 @@ class TestClusterTestListNestedStructListArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestListNestedStructListArgumentRequestParams alloc] init]; - // arg1 Array parsing is not supported yet + + { // 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; + } [cluster testListNestedStructListArgumentRequestWithParams:params completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type mRequest; + TypedComplexArgument> + mComplex_Arg1; }; /* @@ -51280,7 +52402,9 @@ class TestClusterTestListStructArgumentRequest : public ModelCommand { public: TestClusterTestListStructArgumentRequest() : ModelCommand("test-list-struct-argument-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51290,21 +52414,43 @@ class TestClusterTestListStructArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestListStructArgumentRequestParams alloc] init]; - // arg1 Array parsing is not supported yet + + { // 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; + } [cluster testListStructArgumentRequestWithParams:params completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type mRequest; + TypedComplexArgument> + mComplex_Arg1; }; /* @@ -51314,7 +52460,9 @@ class TestClusterTestNestedStructArgumentRequest : public ModelCommand { public: TestClusterTestNestedStructArgumentRequest() : ModelCommand("test-nested-struct-argument-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51324,21 +52472,37 @@ class TestClusterTestNestedStructArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestNestedStructArgumentRequestParams alloc] init]; - // arg1 Struct parsing is not supported yet + + 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]; [cluster testNestedStructArgumentRequestWithParams:params completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; }; /* @@ -51348,7 +52512,9 @@ class TestClusterTestNestedStructListArgumentRequest : public ModelCommand { public: TestClusterTestNestedStructListArgumentRequest() : ModelCommand("test-nested-struct-list-argument-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51358,21 +52524,83 @@ class TestClusterTestNestedStructListArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestNestedStructListArgumentRequestParams alloc] init]; - // arg1 Struct parsing is not supported yet + + 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]; + newElement_1.a = [NSNumber numberWithUnsignedChar:entry_1.a]; + newElement_1.b = [NSNumber numberWithBool:entry_1.b]; + newElement_1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.c)]; + newElement_1.d = [NSData dataWithBytes:entry_1.d.data() length:entry_1.d.size()]; + newElement_1.e = [[NSString alloc] initWithBytes:entry_1.e.data() + length:entry_1.e.size() + encoding:NSUTF8StringEncoding]; + newElement_1.f = [NSNumber numberWithUnsignedChar:entry_1.f.Raw()]; + newElement_1.g = [NSNumber numberWithFloat:entry_1.g]; + 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.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; + } [cluster testNestedStructListArgumentRequestWithParams:params completionHandler:^(CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; }; /* @@ -51392,13 +52620,13 @@ class TestClusterTestNotHandled : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster testNotHandledWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51422,19 +52650,20 @@ class TestClusterTestNullableOptionalRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; [cluster testNullableOptionalRequestWithParams:params completionHandler:^(CHIPTestClusterClusterTestNullableOptionalResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51459,16 +52688,17 @@ class TestClusterTestSimpleOptionalArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithBool:mArg1]; [cluster testSimpleOptionalArgumentRequestWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51492,15 +52722,15 @@ class TestClusterTestSpecific : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster testSpecificWithCompletionHandler:^( CHIPTestClusterClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51513,7 +52743,9 @@ class TestClusterTestStructArgumentRequest : public ModelCommand { public: TestClusterTestStructArgumentRequest() : ModelCommand("test-struct-argument-request") + , mComplex_Arg1(&mRequest.arg1) { + AddArgument("Arg1", &mComplex_Arg1); ModelCommand::AddArguments(); } @@ -51523,21 +52755,34 @@ class TestClusterTestStructArgumentRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPTestClusterClusterTestStructArgumentRequestParams alloc] init]; - // arg1 Struct parsing is not supported yet + + 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]; [cluster testStructArgumentRequestWithParams:params completionHandler:^( CHIPTestClusterClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; }; /* @@ -51557,13 +52802,13 @@ class TestClusterTestUnknownCommand : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster testUnknownCommandWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51586,13 +52831,13 @@ class TestClusterTimedInvokeRequest : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster timedInvokeRequestWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51647,17 +52892,17 @@ class WriteTestClusterBoolean : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; [cluster writeAttributeBooleanWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Boolean Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Boolean Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51758,17 +53003,17 @@ class WriteTestClusterBitmap8 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000001) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeBitmap8WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Bitmap8 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Bitmap8 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51869,17 +53114,17 @@ class WriteTestClusterBitmap16 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000002) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeBitmap16WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Bitmap16 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Bitmap16 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -51980,17 +53225,17 @@ class WriteTestClusterBitmap32 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000003) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeBitmap32WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Bitmap32 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Bitmap32 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52091,17 +53336,17 @@ class WriteTestClusterBitmap64 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000004) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeBitmap64WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Bitmap64 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Bitmap64 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52202,17 +53447,17 @@ class WriteTestClusterInt8u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000005) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeInt8uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int8u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int8u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52313,17 +53558,17 @@ class WriteTestClusterInt16u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000006) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeInt16uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int16u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int16u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52424,17 +53669,17 @@ class WriteTestClusterInt24u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000007) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeInt24uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int24u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int24u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52535,17 +53780,17 @@ class WriteTestClusterInt32u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000008) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeInt32uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int32u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int32u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52646,17 +53891,17 @@ class WriteTestClusterInt40u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000009) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeInt40uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int40u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int40u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52757,17 +54002,17 @@ class WriteTestClusterInt48u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000A) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeInt48uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int48u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int48u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52868,17 +54113,17 @@ class WriteTestClusterInt56u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000B) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeInt56uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int56u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int56u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -52979,17 +54224,17 @@ class WriteTestClusterInt64u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000C) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeInt64uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int64u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int64u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53090,17 +54335,17 @@ class WriteTestClusterInt8s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000D) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; [cluster writeAttributeInt8sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int8s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int8s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53201,17 +54446,17 @@ class WriteTestClusterInt16s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000E) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; [cluster writeAttributeInt16sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int16s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int16s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53312,17 +54557,17 @@ class WriteTestClusterInt24s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000F) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithInt:mValue]; [cluster writeAttributeInt24sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int24s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int24s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53423,17 +54668,17 @@ class WriteTestClusterInt32s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000010) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithInt:mValue]; [cluster writeAttributeInt32sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int32s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int32s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53534,17 +54779,17 @@ class WriteTestClusterInt40s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000011) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeInt40sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int40s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int40s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53645,17 +54890,17 @@ class WriteTestClusterInt48s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000012) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeInt48sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int48s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int48s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53756,17 +55001,17 @@ class WriteTestClusterInt56s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000013) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeInt56sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int56s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int56s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53867,17 +55112,17 @@ class WriteTestClusterInt64s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000014) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeInt64sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Int64s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Int64s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -53978,17 +55223,17 @@ class WriteTestClusterEnum8 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000015) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeEnum8WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Enum8 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Enum8 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -54089,17 +55334,17 @@ class WriteTestClusterEnum16 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000016) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeEnum16WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Enum16 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Enum16 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -54200,17 +55445,17 @@ class WriteTestClusterFloatSingle : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000017) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithFloat:mValue]; [cluster writeAttributeFloatSingleWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster FloatSingle Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster FloatSingle Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -54311,17 +55556,17 @@ class WriteTestClusterFloatDouble : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000018) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithDouble:mValue]; [cluster writeAttributeFloatDoubleWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster FloatDouble Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster FloatDouble Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -54422,17 +55667,17 @@ class WriteTestClusterOctetString : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000019) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSData * _Nonnull value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; [cluster writeAttributeOctetStringWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster OctetString Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster OctetString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -54516,6 +55761,51 @@ class ReadTestClusterListInt8u : public ModelCommand { } }; +class WriteTestClusterListInt8u : public ModelCommand { +public: + WriteTestClusterListInt8u() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-int8u"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterListInt8u() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001A) on endpoint %" PRIu16, 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; + + 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 + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster ListInt8u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + class SubscribeAttributeTestClusterListInt8u : public ModelCommand { public: SubscribeAttributeTestClusterListInt8u() @@ -54593,6 +55883,52 @@ class ReadTestClusterListOctetString : public ModelCommand { } }; +class WriteTestClusterListOctetString : public ModelCommand { +public: + WriteTestClusterListOctetString() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-octet-string"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterListOctetString() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001B) on endpoint %" PRIu16, 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; + + 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 + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster ListOctetString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + class SubscribeAttributeTestClusterListOctetString : public ModelCommand { public: SubscribeAttributeTestClusterListOctetString() @@ -54670,6 +56006,56 @@ class ReadTestClusterListStructOctetString : public ModelCommand { } }; +class WriteTestClusterListStructOctetString : public ModelCommand { +public: + WriteTestClusterListStructOctetString() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-struct-octet-string"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterListStructOctetString() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001C) on endpoint %" PRIu16, 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; + + 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 writeAttributeListStructOctetStringWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster ListStructOctetString Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> + mComplex; +}; + class SubscribeAttributeTestClusterListStructOctetString : public ModelCommand { public: SubscribeAttributeTestClusterListStructOctetString() @@ -54765,17 +56151,18 @@ class WriteTestClusterLongOctetString : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001D) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSData * _Nonnull value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - [cluster writeAttributeLongOctetStringWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster LongOctetString Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeLongOctetStringWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster LongOctetString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -54876,7 +56263,7 @@ class WriteTestClusterCharString : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001E) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() @@ -54884,11 +56271,11 @@ class WriteTestClusterCharString : public ModelCommand { [cluster writeAttributeCharStringWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster CharString Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster CharString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -54989,7 +56376,7 @@ class WriteTestClusterLongCharString : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001F) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() @@ -54997,11 +56384,11 @@ class WriteTestClusterLongCharString : public ModelCommand { [cluster writeAttributeLongCharStringWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster LongCharString Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster LongCharString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -55102,17 +56489,17 @@ class WriteTestClusterEpochUs : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000020) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeEpochUsWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster EpochUs Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster EpochUs Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -55213,17 +56600,17 @@ class WriteTestClusterEpochS : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000021) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeEpochSWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster EpochS Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster EpochS Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -55324,17 +56711,17 @@ class WriteTestClusterVendorId : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000022) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeVendorIdWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster VendorId Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster VendorId Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -55419,6 +56806,206 @@ class ReadTestClusterListNullablesAndOptionalsStruct : public ModelCommand { } }; +class WriteTestClusterListNullablesAndOptionalsStruct : public ModelCommand { +public: + WriteTestClusterListNullablesAndOptionalsStruct() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-nullables-and-optionals-struct"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterListNullablesAndOptionalsStruct() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000023) on endpoint %" PRIu16, 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; + + 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 + writeAttributeListNullablesAndOptionalsStructWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster ListNullablesAndOptionalsStruct Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; +}; + class SubscribeAttributeTestClusterListNullablesAndOptionalsStruct : public ModelCommand { public: SubscribeAttributeTestClusterListNullablesAndOptionalsStruct() @@ -55516,17 +57103,17 @@ class WriteTestClusterEnumAttr : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000024) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeEnumAttrWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster EnumAttr Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster EnumAttr Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -55615,8 +57202,10 @@ class WriteTestClusterStructAttr : public ModelCommand { public: WriteTestClusterStructAttr() : ModelCommand("write") + , mComplex(&mValue) { AddArgument("attr-name", "struct-attr"); + AddArgument("attr-value", &mComplex); ModelCommand::AddArguments(); } @@ -55627,20 +57216,31 @@ class WriteTestClusterStructAttr : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000025) on endpoint %" PRIu16, 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; - - CHIPTestClusterClusterSimpleStruct * value = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + 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 writeAttributeStructAttrWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster StructAttr Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster StructAttr Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type mValue; + TypedComplexArgument mComplex; }; class SubscribeAttributeTestClusterStructAttr : public ModelCommand { @@ -55738,18 +57338,18 @@ class WriteTestClusterRangeRestrictedInt8u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000026) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster - writeAttributeRangeRestrictedInt8uWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster RangeRestrictedInt8u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeRangeRestrictedInt8uWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster RangeRestrictedInt8u Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -55851,18 +57451,18 @@ class WriteTestClusterRangeRestrictedInt8s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000027) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; - [cluster - writeAttributeRangeRestrictedInt8sWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster RangeRestrictedInt8s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeRangeRestrictedInt8sWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster RangeRestrictedInt8s Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -55964,18 +57564,18 @@ class WriteTestClusterRangeRestrictedInt16u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000028) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeRangeRestrictedInt16uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "TestCluster RangeRestrictedInt16u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster RangeRestrictedInt16u Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -56077,18 +57677,18 @@ class WriteTestClusterRangeRestrictedInt16s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000029) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; [cluster writeAttributeRangeRestrictedInt16sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError( - chipTool, "TestCluster RangeRestrictedInt16s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster RangeRestrictedInt16s Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -56173,6 +57773,52 @@ class ReadTestClusterListLongOctetString : public ModelCommand { } }; +class WriteTestClusterListLongOctetString : public ModelCommand { +public: + WriteTestClusterListLongOctetString() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-long-octet-string"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterListLongOctetString() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000002A) on endpoint %" PRIu16, 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; + + 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 writeAttributeListLongOctetStringWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster ListLongOctetString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + class SubscribeAttributeTestClusterListLongOctetString : public ModelCommand { public: SubscribeAttributeTestClusterListLongOctetString() @@ -56253,6 +57899,102 @@ class ReadTestClusterListFabricScoped : public ModelCommand { } }; +class WriteTestClusterListFabricScoped : public ModelCommand { +public: + WriteTestClusterListFabricScoped() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "list-fabric-scoped"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterListFabricScoped() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000002B) on endpoint %" PRIu16, 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; + + 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 + writeAttributeListFabricScopedWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster ListFabricScoped Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> + mComplex; +}; + class SubscribeAttributeTestClusterListFabricScoped : public ModelCommand { public: SubscribeAttributeTestClusterListFabricScoped() @@ -56347,17 +58089,18 @@ class WriteTestClusterTimedWriteBoolean : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000030) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeTimedWriteBooleanWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster TimedWriteBoolean Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeTimedWriteBooleanWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster TimedWriteBoolean Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -56458,18 +58201,18 @@ class WriteTestClusterGeneralErrorBoolean : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000031) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster - writeAttributeGeneralErrorBooleanWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster GeneralErrorBoolean Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeGeneralErrorBooleanWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster GeneralErrorBoolean Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -56571,18 +58314,18 @@ class WriteTestClusterClusterErrorBoolean : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000032) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; - [cluster - writeAttributeClusterErrorBooleanWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster ClusterErrorBoolean Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeClusterErrorBooleanWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster ClusterErrorBoolean Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -56684,17 +58427,17 @@ class WriteTestClusterUnsupported : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x000000FF) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; [cluster writeAttributeUnsupportedWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster Unsupported Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster Unsupported Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -56795,17 +58538,18 @@ class WriteTestClusterNullableBoolean : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008000) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithBool:mValue]; - [cluster writeAttributeNullableBooleanWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableBoolean Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeNullableBooleanWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableBoolean Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -56906,17 +58650,18 @@ class WriteTestClusterNullableBitmap8 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008001) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeNullableBitmap8WithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableBitmap8 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeNullableBitmap8WithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableBitmap8 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -57017,17 +58762,18 @@ class WriteTestClusterNullableBitmap16 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008002) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; - [cluster writeAttributeNullableBitmap16WithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableBitmap16 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeNullableBitmap16WithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableBitmap16 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -57128,17 +58874,18 @@ class WriteTestClusterNullableBitmap32 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008003) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; - [cluster writeAttributeNullableBitmap32WithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableBitmap32 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeNullableBitmap32WithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableBitmap32 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -57239,17 +58986,18 @@ class WriteTestClusterNullableBitmap64 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008004) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; - [cluster writeAttributeNullableBitmap64WithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableBitmap64 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeNullableBitmap64WithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableBitmap64 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -57350,17 +59098,17 @@ class WriteTestClusterNullableInt8u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008005) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeNullableInt8uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt8u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt8u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -57461,17 +59209,17 @@ class WriteTestClusterNullableInt16u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008006) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeNullableInt16uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt16u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt16u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -57572,17 +59320,17 @@ class WriteTestClusterNullableInt24u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008007) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeNullableInt24uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt24u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt24u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -57683,17 +59431,17 @@ class WriteTestClusterNullableInt32u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008008) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; [cluster writeAttributeNullableInt32uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt32u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt32u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -57794,17 +59542,17 @@ class WriteTestClusterNullableInt40u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008009) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeNullableInt40uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt40u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt40u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -57905,17 +59653,17 @@ class WriteTestClusterNullableInt48u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800A) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeNullableInt48uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt48u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt48u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58016,17 +59764,17 @@ class WriteTestClusterNullableInt56u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800B) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeNullableInt56uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt56u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt56u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58127,17 +59875,17 @@ class WriteTestClusterNullableInt64u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800C) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; [cluster writeAttributeNullableInt64uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt64u Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt64u Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58238,17 +59986,17 @@ class WriteTestClusterNullableInt8s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800D) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; [cluster writeAttributeNullableInt8sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt8s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt8s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58349,17 +60097,17 @@ class WriteTestClusterNullableInt16s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800E) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; [cluster writeAttributeNullableInt16sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt16s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt16s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58460,17 +60208,17 @@ class WriteTestClusterNullableInt24s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800F) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; [cluster writeAttributeNullableInt24sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt24s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt24s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58571,17 +60319,17 @@ class WriteTestClusterNullableInt32s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008010) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; [cluster writeAttributeNullableInt32sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt32s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt32s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58682,17 +60430,17 @@ class WriteTestClusterNullableInt40s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008011) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeNullableInt40sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt40s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt40s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58793,17 +60541,17 @@ class WriteTestClusterNullableInt48s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008012) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeNullableInt48sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt48s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt48s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -58904,17 +60652,17 @@ class WriteTestClusterNullableInt56s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008013) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeNullableInt56sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt56s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt56s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -59015,17 +60763,17 @@ class WriteTestClusterNullableInt64s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008014) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; [cluster writeAttributeNullableInt64sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableInt64s Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableInt64s Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -59126,17 +60874,17 @@ class WriteTestClusterNullableEnum8 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008015) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeNullableEnum8WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableEnum8 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableEnum8 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -59237,17 +60985,17 @@ class WriteTestClusterNullableEnum16 : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008016) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeNullableEnum16WithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableEnum16 Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableEnum16 Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -59348,18 +61096,18 @@ class WriteTestClusterNullableFloatSingle : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008017) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithFloat:mValue]; - [cluster - writeAttributeNullableFloatSingleWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableFloatSingle Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeNullableFloatSingleWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster NullableFloatSingle Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -59461,18 +61209,18 @@ class WriteTestClusterNullableFloatDouble : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008018) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithDouble:mValue]; - [cluster - writeAttributeNullableFloatDoubleWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableFloatDouble Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeNullableFloatDoubleWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster NullableFloatDouble Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -59574,18 +61322,18 @@ class WriteTestClusterNullableOctetString : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008019) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSData * _Nullable value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - [cluster - writeAttributeNullableOctetStringWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableOctetString Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeNullableOctetStringWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster NullableOctetString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -59687,20 +61435,20 @@ class WriteTestClusterNullableCharString : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000801E) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSString * _Nullable value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; - [cluster - writeAttributeNullableCharStringWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableCharString Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeNullableCharStringWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "TestCluster NullableCharString Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -59802,17 +61550,18 @@ class WriteTestClusterNullableEnumAttr : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008024) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeNullableEnumAttrWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableEnumAttr Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeNullableEnumAttrWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableEnumAttr Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -59901,8 +61650,10 @@ class WriteTestClusterNullableStruct : public ModelCommand { public: WriteTestClusterNullableStruct() : ModelCommand("write") + , mComplex(&mValue) { AddArgument("attr-name", "nullable-struct"); + AddArgument("attr-value", &mComplex); ModelCommand::AddArguments(); } @@ -59913,20 +61664,37 @@ class WriteTestClusterNullableStruct : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008025) on endpoint %" PRIu16, 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; - - CHIPTestClusterClusterSimpleStruct * value = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; + + 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 writeAttributeNullableStructWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TestCluster NullableStruct Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TestCluster NullableStruct Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: + chip::app::DataModel::Nullable mValue; + TypedComplexArgument> mComplex; }; class SubscribeAttributeTestClusterNullableStruct : public ModelCommand { @@ -60025,18 +61793,18 @@ class WriteTestClusterNullableRangeRestrictedInt8u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008026) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt8u Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60140,18 +61908,18 @@ class WriteTestClusterNullableRangeRestrictedInt8s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008027) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt8s Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60255,19 +62023,19 @@ class WriteTestClusterNullableRangeRestrictedInt16u : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008028) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt16u Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60372,19 +62140,19 @@ class WriteTestClusterNullableRangeRestrictedInt16s : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008029) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "TestCluster NullableRangeRestrictedInt16s Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60829,13 +62597,13 @@ class ThermostatClearWeeklySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster clearWeeklyScheduleWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60858,15 +62626,15 @@ class ThermostatGetRelayStatusLog : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster getRelayStatusLogWithCompletionHandler:^( CHIPThermostatClusterGetRelayStatusLogResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60891,19 +62659,21 @@ class ThermostatGetWeeklySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPThermostatClusterGetWeeklyScheduleParams alloc] init]; + params.daysToReturn = [NSNumber numberWithUnsignedChar:mDaysToReturn]; + params.modeToReturn = [NSNumber numberWithUnsignedChar:mModeToReturn]; [cluster getWeeklyScheduleWithParams:params completionHandler:^( CHIPThermostatClusterGetWeeklyScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -60918,10 +62688,12 @@ class ThermostatSetWeeklySchedule : public ModelCommand { public: ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule") + , mComplex_Payload(&mRequest.payload) { AddArgument("NumberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence); AddArgument("DayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence); AddArgument("ModeForSequence", 0, UINT8_MAX, &mModeForSequence); + AddArgument("Payload", &mComplex_Payload); ModelCommand::AddArguments(); } @@ -60931,25 +62703,39 @@ class ThermostatSetWeeklySchedule : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPThermostatClusterSetWeeklyScheduleParams alloc] init]; + params.numberOfTransitionsForSequence = [NSNumber numberWithUnsignedChar:mNumberOfTransitionsForSequence]; + params.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:mDayOfWeekForSequence]; + params.modeForSequence = [NSNumber numberWithUnsignedChar:mModeForSequence]; - // payload Array parsing is not supported yet + + { // 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; + } [cluster setWeeklyScheduleWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: uint8_t mNumberOfTransitionsForSequence; uint8_t mDayOfWeekForSequence; uint8_t mModeForSequence; + chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type mRequest; + TypedComplexArgument> mComplex_Payload; }; /* @@ -60971,17 +62757,19 @@ class ThermostatSetpointRaiseLower : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPThermostatClusterSetpointRaiseLowerParams alloc] init]; + params.mode = [NSNumber numberWithUnsignedChar:mMode]; + params.amount = [NSNumber numberWithChar:mAmount]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -61432,18 +63220,18 @@ class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000011) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; [cluster writeAttributeOccupiedCoolingSetpointWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "Thermostat OccupiedCoolingSetpoint Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -61546,18 +63334,18 @@ class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000012) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; [cluster writeAttributeOccupiedHeatingSetpointWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "Thermostat OccupiedHeatingSetpoint Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -61659,18 +63447,18 @@ class WriteThermostatMinHeatSetpointLimit : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000015) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster - writeAttributeMinHeatSetpointLimitWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Thermostat MinHeatSetpointLimit Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeMinHeatSetpointLimitWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Thermostat MinHeatSetpointLimit Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -61772,18 +63560,18 @@ class WriteThermostatMaxHeatSetpointLimit : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000016) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster - writeAttributeMaxHeatSetpointLimitWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Thermostat MaxHeatSetpointLimit Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Thermostat MaxHeatSetpointLimit Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -61885,18 +63673,18 @@ class WriteThermostatMinCoolSetpointLimit : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000017) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster - writeAttributeMinCoolSetpointLimitWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Thermostat MinCoolSetpointLimit Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeMinCoolSetpointLimitWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Thermostat MinCoolSetpointLimit Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -61998,18 +63786,18 @@ class WriteThermostatMaxCoolSetpointLimit : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000018) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithShort:mValue]; - [cluster - writeAttributeMaxCoolSetpointLimitWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Thermostat MaxCoolSetpointLimit Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Thermostat MaxCoolSetpointLimit Error: %s", + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -62111,18 +63899,18 @@ class WriteThermostatMinSetpointDeadBand : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000019) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithChar:mValue]; - [cluster - writeAttributeMinSetpointDeadBandWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Thermostat MinSetpointDeadBand Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster writeAttributeMinSetpointDeadBandWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "Thermostat MinSetpointDeadBand Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -62225,18 +64013,18 @@ class WriteThermostatControlSequenceOfOperation : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001B) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeControlSequenceOfOperationWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "Thermostat ControlSequenceOfOperation Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -62339,17 +64127,17 @@ class WriteThermostatSystemMode : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001C) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeSystemModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "Thermostat SystemMode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "Thermostat SystemMode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -62938,19 +64726,19 @@ class WriteThermostatUserInterfaceConfigurationTemperatureDisplayMode : public M 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeTemperatureDisplayModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "ThermostatUserInterfaceConfiguration TemperatureDisplayMode Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -63056,18 +64844,18 @@ class WriteThermostatUserInterfaceConfigurationKeypadLockout : public ModelComma 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeKeypadLockoutWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "ThermostatUserInterfaceConfiguration KeypadLockout Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -63174,20 +64962,20 @@ class WriteThermostatUserInterfaceConfigurationScheduleProgrammingVisibility : p 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeScheduleProgrammingVisibilityWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility " "Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -63666,13 +65454,13 @@ class ThreadNetworkDiagnosticsResetCounts : public ModelCommand { CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -69335,17 +71123,18 @@ class WriteTimeFormatLocalizationHourFormat : public ModelCommand { CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeHourFormatWithValue:value - completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "TimeFormatLocalization HourFormat Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); - }]; - return err; + [cluster + writeAttributeHourFormatWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "TimeFormatLocalization HourFormat Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; } private: @@ -69452,18 +71241,18 @@ class WriteTimeFormatLocalizationActiveCalendarType : public ModelCommand { CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeActiveCalendarTypeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; + chipError = [CHIPError errorToCHIPErrorCode:error]; ChipLogError(chipTool, "TimeFormatLocalization ActiveCalendarType Error: %s", - chip::ErrorStr(err)); - SetCommandExitStatus(err); + chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -69915,17 +71704,18 @@ class WriteUnitLocalizationTemperatureUnit : public ModelCommand { CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeTemperatureUnitWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "UnitLocalization TemperatureUnit Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError( + chipTool, "UnitLocalization TemperatureUnit Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -70270,6 +72060,57 @@ class ReadUserLabelLabelList : public ModelCommand { } }; +class WriteUserLabelLabelList : public ModelCommand { +public: + WriteUserLabelLabelList() + : ModelCommand("write") + , mComplex(&mValue) + { + AddArgument("attr-name", "label-list"); + AddArgument("attr-value", &mComplex); + ModelCommand::AddArguments(); + } + + ~WriteUserLabelLabelList() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000041) WriteAttribute (0x00000000) on endpoint %" PRIu16, 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 chipError = CHIP_NO_ERROR; + + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + CHIPUserLabelClusterLabelStruct * newElement_0; + newElement_0 = [CHIPUserLabelClusterLabelStruct new]; + newElement_0.label = [[NSString alloc] initWithBytes:entry_0.label.data() + length:entry_0.label.size() + encoding:NSUTF8StringEncoding]; + newElement_0.value = [[NSString alloc] initWithBytes:entry_0.value.data() + length:entry_0.value.size() + encoding:NSUTF8StringEncoding]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeLabelListWithValue:value + completionHandler:^(NSError * _Nullable error) { + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "UserLabel LabelList Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); + }]; + return chipError; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + class SubscribeAttributeUserLabelLabelList : public ModelCommand { public: SubscribeAttributeUserLabelLabelList() @@ -71002,13 +72843,13 @@ class WiFiNetworkDiagnosticsResetCounts : public ModelCommand { CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIP_ERROR __block err = CHIP_NO_ERROR; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72545,13 +74386,13 @@ class WindowCoveringDownOrClose : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster downOrCloseWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72576,17 +74417,19 @@ class WindowCoveringGoToLiftPercentage : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftPercentageParams alloc] init]; + params.liftPercentageValue = [NSNumber numberWithUnsignedChar:mLiftPercentageValue]; + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue]; [cluster goToLiftPercentageWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72612,16 +74455,17 @@ class WindowCoveringGoToLiftValue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPWindowCoveringClusterGoToLiftValueParams alloc] init]; + params.liftValue = [NSNumber numberWithUnsignedShort:mLiftValue]; [cluster goToLiftValueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72647,17 +74491,19 @@ class WindowCoveringGoToTiltPercentage : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltPercentageParams alloc] init]; + params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:mTiltPercentageValue]; + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue]; [cluster goToTiltPercentageWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72683,16 +74529,17 @@ class WindowCoveringGoToTiltValue : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; __auto_type * params = [[CHIPWindowCoveringClusterGoToTiltValueParams alloc] init]; + params.tiltValue = [NSNumber numberWithUnsignedShort:mTiltValue]; [cluster goToTiltValueWithParams:params completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72716,13 +74563,13 @@ class WindowCoveringStopMotion : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster stopMotionWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -72745,13 +74592,13 @@ class WindowCoveringUpOrOpen : public ModelCommand { 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; [cluster upOrOpenWithCompletionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -74077,17 +75924,17 @@ class WriteWindowCoveringMode : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000102) WriteAttribute (0x00000017) on endpoint %" PRIu16, 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; + CHIP_ERROR __block chipError = CHIP_NO_ERROR; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; [cluster writeAttributeModeWithValue:value completionHandler:^(NSError * _Nullable error) { - err = [CHIPError errorToCHIPErrorCode:error]; - ChipLogError(chipTool, "WindowCovering Mode Error: %s", chip::ErrorStr(err)); - SetCommandExitStatus(err); + chipError = [CHIPError errorToCHIPErrorCode:error]; + ChipLogError(chipTool, "WindowCovering Mode Error: %s", chip::ErrorStr(chipError)); + SetCommandExitStatus(chipError); }]; - return err; + return chipError; } private: @@ -74612,8 +76459,10 @@ void registerClusterAccessControl(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -74870,6 +76719,7 @@ void registerClusterBinding(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -75528,6 +77378,7 @@ void registerClusterGroupKeyManagement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -75906,6 +77757,7 @@ void registerClusterOtaSoftwareUpdateRequestor(Commands & commands) commands_list clusterCommands = { make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -76445,10 +78297,13 @@ void registerClusterTestCluster(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(), // @@ -76469,6 +78324,7 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -76489,8 +78345,10 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -76897,6 +78755,7 @@ void registerClusterUserLabel(Commands & commands) commands_list clusterCommands = { make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), //